I have gotten slightly further along with this plugin. I am sure I am doing something wrong; maybe this will make my situation more clear and someone can help me out here?
Music is playing but the main Volumio display with the song/track information is blank. I have the stop() method in onStop, and it stops when I switch the plugin to “off” in “Installed Plugins”, but the interface restarts and the plugin loads back up afterwards.
I still have the login information hard-coded into a settings.js file. I have a menu item loaded in Volumio and the values save, but I’m not sure what to do about the initial loading, since the object needs the login info to load itself. I’ll keep at this but I’m more concerned about displaying the song metadata at the moment.
As far as I can tell, the stream should be a 64kbps AAC file if that is needed here. I can try to verify this. I only have the free version of Pandora.
Here is what I have in parseState:
[code]//Parse state
ControllerPandora.prototype.parseState = function(state) {
var self = this;
self.commandRouter.pushConsoleMessage(’[’ + Date.now() + '] ’ + ‘ControllerPandora::parseState’);
var sStatus;
var myPromise = new Promise(function(resolve,reject) {
var objStatus = self.pandora.getStatus();
if (objStatus.status === 'playing') {
sStatus = 'play';
} else if (objStatus.status === 'paused') {
sStatus = 'pause';
} else if (objStatus.status === 'not running' || objStatus.status === 'undefined') {
sStatus = 'stop';
}
if (state && sStatus) {
var parsedState = {
status: sStatus,
service: self.serviceName,
type: 'pandora-station', // is this needed?
position: state.timePlayed,
seek: state.timePlayed * 1000,
duration: Number(state.songDuration),
//samplerate: self.samplerate, // is this needed?
//bitdepth: null, // is this needed?
channels: 2,
artist: state.artist,
title: state.title,
album: state.album,
albumart: state.art
};
resolve(parsedState);
}
else {
reject('Bad state/status information passed into parseState');
}
});
return myPromise;
//Use this method to parse the state and eventually send it with the following function
};[/code]
And below is the log from journalctl:
Jun 08 11:20:17 volumio volumio[877]: [20B blob data]
Jun 08 11:20:17 volumio volumio[877]: info: [1528456817464] ControllerPandora::parseState
Jun 08 11:20:17 volumio volumio[877]: Time
Jun 08 11:20:17 volumio volumio[877]: info: [1528456817466] ControllerPandora::pushState
Jun 08 11:20:17 volumio volumio[877]: info: [Pandora] Pushing state
Jun 08 11:20:17 volumio volumio[877]: info: CoreCommandRouter::servicePushState
Jun 08 11:20:17 volumio volumio[877]: info: CoreStateMachine::syncState
Jun 08 11:20:17 volumio volumio[877]: info: CorePlayQueue::getTrack 0
Jun 08 11:20:17 volumio volumio[877]: info: STATE SERVICE {"status":"play","type":"pandora-station","position":36,"seek":36000,"duration":577,"channels":2,"artist":"Miles Davis Quintet","title":"Footprints (Antwerp, Belgium 10/28/67)","album":"Live In Europe 1967: The Bootleg Series Vol. 1","albumart":"http://cont-2.p-cdn.us/images/public/rovi/albumart/5/2/3/5/886979405325_500W_500H.jpg"}
Jun 08 11:20:17 volumio volumio[877]: info: CURRENT POSITION 0
Jun 08 11:20:17 volumio volumio[877]: info: CoreStateMachine::syncState stateService play
Jun 08 11:20:17 volumio volumio[877]: info: CoreStateMachine::syncState currentStatus play
Jun 08 11:20:17 volumio volumio[877]: info: Received an update from plaugin. extracting info from payload
Jun 08 11:20:17 volumio volumio[877]: info: CoreStateMachine::pushState
Jun 08 11:20:17 volumio volumio[877]: info: CoreStateMachine::getState
Jun 08 11:20:17 volumio volumio[877]: info: CorePlayQueue::getTrack 0
Jun 08 11:20:17 volumio volumio[877]: info: CoreCommandRouter::volumioPushState
Jun 08 11:20:17 volumio volumio[877]: info: CoreCommandRouter::executeOnPlugin: volumiodiscovery , saveDeviceInfo
Jun 08 11:20:17 volumio volumio[877]: info: interfaceApi::pushState
Jun 08 11:20:17 volumio volumio[877]: info: CoreStateMachine::pushState
Jun 08 11:20:17 volumio volumio[877]: info: CoreStateMachine::getState
Jun 08 11:20:17 volumio volumio[877]: info: CorePlayQueue::getTrack 0
Jun 08 11:20:17 volumio volumio[877]: info: CoreCommandRouter::volumioPushState
Jun 08 11:20:17 volumio volumio[877]: info: CoreCommandRouter::executeOnPlugin: volumiodiscovery , saveDeviceInfo
Jun 08 11:20:17 volumio volumio[877]: info: interfaceApi::pushState
Jun 08 11:20:17 volumio volumio[877]: info: Pushing Favourites {"service":"mpd","uri":"","favourite":false}
Jun 08 11:20:17 volumio volumio[877]: info: Pushing Favourites {"service":"mpd","uri":"","favourite":false}
Jun 08 11:20:18 volumio volumio[877]: [20B blob data]
Jun 08 11:20:18 volumio volumio[877]: info: [1528456818465] ControllerPandora::parseState
Jun 08 11:20:18 volumio volumio[877]: Time
Jun 08 11:20:18 volumio volumio[877]: info: [1528456818467] ControllerPandora::pushState
Jun 08 11:20:18 volumio volumio[877]: info: [Pandora] Pushing state
Jun 08 11:20:18 volumio volumio[877]: info: CoreCommandRouter::servicePushState
Jun 08 11:20:18 volumio volumio[877]: info: CoreStateMachine::syncState
Jun 08 11:20:18 volumio volumio[877]: info: CorePlayQueue::getTrack 0
Jun 08 11:20:18 volumio volumio[877]: info: STATE SERVICE {"status":"play","type":"pandora-station","position":37,"seek":37000,"duration":577,"channels":2,"artist":"Miles Davis Quintet","title":"Footprints (Antwerp, Belgium 10/28/67)","album":"Live In Europe 1967: The Bootleg Series Vol. 1","albumart":"http://cont-2.p-cdn.us/images/public/rovi/albumart/5/2/3/5/886979405325_500W_500H.jpg"}
Jun 08 11:20:18 volumio volumio[877]: info: CURRENT POSITION 0
Jun 08 11:20:18 volumio volumio[877]: info: CoreStateMachine::syncState stateService play
Jun 08 11:20:18 volumio volumio[877]: info: CoreStateMachine::syncState currentStatus play
Jun 08 11:20:18 volumio volumio[877]: info: Received an update from plaugin. extracting info from payload
Jun 08 11:20:18 volumio volumio[877]: info: CoreStateMachine::pushState
Jun 08 11:20:18 volumio volumio[877]: info: CoreStateMachine::getState
Jun 08 11:20:18 volumio volumio[877]: info: CorePlayQueue::getTrack 0
Jun 08 11:20:18 volumio volumio[877]: info: CoreCommandRouter::volumioPushState
Jun 08 11:20:18 volumio volumio[877]: info: CoreCommandRouter::executeOnPlugin: volumiodiscovery , saveDeviceInfo
Jun 08 11:20:18 volumio volumio[877]: info: interfaceApi::pushState
Jun 08 11:20:18 volumio volumio[877]: info: CoreStateMachine::pushState
Jun 08 11:20:18 volumio volumio[877]: info: CoreStateMachine::getState
Jun 08 11:20:18 volumio volumio[877]: info: CorePlayQueue::getTrack 0
Jun 08 11:20:18 volumio volumio[877]: info: CoreCommandRouter::volumioPushState
Jun 08 11:20:18 volumio volumio[877]: info: CoreCommandRouter::executeOnPlugin: volumiodiscovery , saveDeviceInfo
Jun 08 11:20:18 volumio volumio[877]: info: interfaceApi::pushState
Jun 08 11:20:18 volumio volumio[877]: info: Pushing Favourites {"service":"mpd","uri":"","favourite":false}
Jun 08 11:20:18 volumio volumio[877]: info: Pushing Favourites {"service":"mpd","uri":"","favourite":false}
Again, thanks for any and all help. I’m only trying to give back in a small way to the open source community for all the things I use every day.