Arduino serial communication with mrl

Hi guys, This is my first time ever using myrobotlab and it is one of the most coolest and intuitive applications i have ever used. I pulled out an arduino last week and tried to mess around the chess services by sending chess commands using the serial port. Unfortunately every time i put a serial.println code in the void loop section of the mrlcomm (after setting the baud rate of course) and uploading to my robotlab, i get an error saying: like the following:

 

“Arduino mrs bad magic number 10”

when i have a any other sketches (like blink or output a pin in mrl.comm) that don’t require "serial.println" everything works fine.

 

Any help is much appreciated, Also any information relating to how to setup and understand how to send chess comands from and to my arduino via the serial port would also be helpful.

Thank you!!

Ray.Edgley's picture

Have you recently updated the

Have you recently updated the version of MRL that you are running?

If you have you may need to update the version of MRLComm running in your Arduino

 

greg's picture

Hi, i'm using the latest

Hi, i'm using the latest build, Where can i find an MRLcomm update for that. thanks

GroG's picture

Hi Greg and Welcome !  The

Hi Greg and Welcome ! 

The MRLComm which you should use is "always" bundled with the myrobotlab.jar - that way versions always match.

you might want to watch the following Arduino videos - 

https://www.youtube.com/watch?v=AJasOtkCbro&t=84s

https://www.youtube.com/watch?v=-EQxjpsOJDg 

Additionally, you might want to check out the "basics" video -

https://www.youtube.com/watch?v=lmNWvJzjH1k 

The latest myrobotlab.jar can be found above the shoutbox - "latest build"

 

You might be interested in browsing through the "matrix" - another link at the top of the shoutbox, to see some of the "services" offered through MyRobotLab (MRL).

Happy Roboting Greg !

greg's picture

Thanks aloy for the

Thanks aloy for the information package,i'll get right on it then.

greg's picture

Hi GroG, Finished they

Hi GroG, Finished they installation anew and went through the tutorials (thanks). Unfortunately I’m still in the same boat. Do you mind giving me a brief explanation of sending data to and from the mrl via serial using the chess game manager.

calamity's picture

Hi greg When you da a

Hi greg

When you da a serial.print from an arduino sketch, it send data into the serial lane that is read by MRL

MRL will expect structured message on the serial lane, your serial.println probably don't give that structured message so MRL don't understand it and raise errors.

The serial port of the arduino is always used by MRL so you can't use it to send data to another program or the arduino serial monitor.

 

There is way to use the data send by the arduino, but we need to know more about what you are trying to do to guide you in this way

 

greg's picture

.

Hi ,what I’m trying to do is send a chess move from the chess game  service to the Arduino and vice versa. Via serial. Can you please elaborate on what you mean by structured message? How  would I go about communicating between Arduino and MRLComm cia a serial port. Thank you

calamity's picture

about one year ago I

about one year ago I implement something to make what you want possible. I don't know if it was still working since it was many change in MRL/MRLCOMM since then

you may want to look at this python script and mrlcomm.ino file for an example

 

https://github.com/MyRobotLab/pyrobotlab/blob/develop/home/Calamity/cust...

https://github.com/MyRobotLab/pyrobotlab/blob/develop/home/Calamity/cust...

greg's picture

Thank you very much, this was

Thank you very much, this was really helpful. Would you mind explaining or pointing me in any direction that i can find information on using and understanding the MrlMsg class.