Members | Sign In
Legacy MOVI User Community Forum (readonly) > MOVI Question & Answers

Trouble with serial communication and Arduino Mega 2560 ( long post)

posted Dec 20, 2016 18:31:57 by Lucas Nebot
Hi there,

I'm trying to build an arduino based home assistant. Until now I used an Arduino Uno with an ethernet shield (W5100) and the MOVI (stacked in that order from bottom to top). Since the ethernet shield occupies the pins 10 to 13 I rewired the serial communication using the jumper 2 and jumper 3 following the instructions in the manual. The ethernet shield is used to communicate with a Sonos speaker using this library. I didn't bother to understand completly how it works but it seems that an EthernetClient is created to send XML Data to the Sonos.

Everything worked like a charm but I needed more memory so I ordered an original Arduino Mega 2560 Rev.3, stacked the shields as mentioned on it and uploaded the exact same sketch. Unfortunately it did not work.

I tested a few things:
- Both shield used separately with the Arduino Mega work fine.
- The Movi/Arduino work with the example sketches when the ethernet shield is plugged in between but not used.
- When I try to upload and run a sketch using the MOVI AND Sonos library the MOVI boots and trains normally but I can't communicate with it through the serial monitor (no PING, no responeses, no events ..). In adittion the code linked to the MOVI events isn't executed when the event is triggered.

With my limited knowledge I figured that there has to be a problem with the serial comunication so I tried to rewire it on the Mega just like I did with the Arduino Uno:

MOVI recognizer(true,8,7);
(The wiring is correct)

If I upload a sketch to the Mega using the constructor above the MOVI does not react at all and I can't comunicate through the Serial Monitor.

So I tried the new constructor added in the library version 1.05 (I think):

MOVI recognizer(true, Serial1); void setup() { Serial1.begin(9600); recognizer.init(); ...

This seems to be incorrect since I'm getting the error: "no matching function for call to 'MOVI::MOVI(bool, HardwareSerial&)'"

And here I am: Nothing works and I am quite frustrated.

So, first of all thank you for taking the time and reading through all of this. I would really appreciate if someone could point me to the right direction: Is it really a problem with serial comunication and if it is what am I doing wrong?

Thanks in advance and greetings from Germany

[Last edited Dec 20, 2016 18:32:46]
page   1
2 replies
Dylan said Dec 22, 2016 05:23:17

I helped to develop the enhancement to include the HardwareSerial constructor for boards like the Mega. I think you are close. My MOVI declaration looks like this right now:

MOVI movi(false, &Serial1);

I think you're missing the ampersand (&). Try putting that in front of the Serial1 parameter in your MOVI instance declaration and see if your compilation gets further.

Good luck!
Lucas Nebot said Dec 22, 2016 23:51:02
Hi Dylan,
thanks for the help. I'm staying at my parents house during the holidays so I'll try it out in January.

Best regards,
Login below to reply: