Ellerbach/Nabaztag.Net

EventMode - Newtonsoft - Invalid cast

jasongb opened this issue · 7 comments

Nabaztag.cs, line 145 is throwing the following error:

"Unable to cast object of type 'Nabaztag.Net.Models.EventType[]' to type 'System.Enum'."

I've tried to follow the advice of multiple stackoverflow articles, but none of them have worked.

Any ideas?

I pushed a quick fix, should work. Please let me know.

It appears to be failing at a different point now.

Messages for sleep and wake seem to work fine - but on line 167 of Nabaztag.cs, when Events is an array of "Buttons, Ears, Asr", although the ret variable is "123", the response ErrorMessage is "Unknown or malformed mode packet".

I thought that the Asr might be an issue, since I have a Nabaztag (no belly button) and perhaps 'Asr' referred to a capability my bunny did not have. I omitted it from the array, but still had the same error.

I wish I could contribute more than complain!

Issue is coming from the serialization which does not happen as expected. Nabaztag code only supports lowercase. Should work better now. Please continue to pass issues.

PS: I found some other issues, will continue to fix. Sorry, I was (and I am still) fully busy with work!

Should now work fully correct for the events:

Your Nabaztag is in interactive mode and will receive all events
New button event: Down
New button event: Up
New button event: Click
New button event: Down
New button event: Hold
Nabaztag status changed, new status is Recording
New button event: Down
New button event: Click
Nabaztag status changed, new status is Idle
New asr event. Intent: clock, Time: 1587975374.5389247
New asr event. Intent: clock, Time: 1587975377.1260304
New ear event. Left: 8 Right: 0 Ear:
New ear event. Left: 0 Right: 0 Ear:
New button event: Down
New button event: Up
New button event: Down
New button event: Up
New button event: DoubleClick

So you'll have much more things working:

  • added the test (the same you have in the web UI) to test the ears and the led
  • Fixed couple of issues in serializing and deserializing
  • All events seems to work correctly
  • Asr message are received properly
  • The Message for audio seems to work properly

Still not working:

  • Playing a full choreography with command or message

Still to add:

  • Support for streamed audio or equivalent
  • time conversion to normal DateTime in the events

@jasongb I worked on supporting all features. There is a solid version now. You have have examples for every supported features.
I encourage you to switch to the master branch for nabd as in the 0.7.4 version, for example in interactive mode, you won't get any event at all.
What is missing now is the RFID support 😊
Please let me know if anything is not working as expected. I'm also interested in your scenario!