Hello MyRobotLab community !

I am writing a script to control my 6DOF robotic arm with arduino through my laptop. you WinXP 32bit / Python 2.7

The script that i try to make run gave a number of errors, but now just one remains.

"Bad magic number"

Arduino board is a clone Robotdyn UNO CH340.

Can someone take a look at it and say if something is wrong ?

PS. Some comments are in roumanian but the code is comprehensible enough, I think :)

PS #2. 90% of the script is taken from examples.

Thank you very much !

moz4r

6 years 10 months ago

Hi ! what mrl version you are using
just launched your hybrid script seem worky
Can you check common GND ?

It's very common to get that error message. 

Sometimes there is garbage in the buffer before the Arduino service and MRLComm are in sync. That's when you get "bad magic number". The "magic number" is 170 ( 0xAA ) and is used to mark the start of a new message. If you only get it once, at the start of the communication, and the rest is working fine, then you can ignore that message.

 

 

Hi !

If you mean common GND between Arduino - Servo - Power supply, Yes there is common ground between them.

Hello !

Answers :

@moz4r -> I have been using MRL v43 because that one i could find, meanwhile I uploaded v40.

@Mats -> I have looked at the logs, can't seem to find magic number 170 in my logs, maybe something is wrong with the connection with arduino. 

@GroG -> I made some progress, eliminated some error, started arduino before I ran the script so the arduino serial has time to establish communication on COM 3. But sadly, an error keeps showing up after every command sent to arduino --> "[ERROR] arduino error unknown serial event 10".

I have attached the logs and my script.

Thank you very much!

King regards,

Belizard

Files

/sites/default/files/users/user1897files/Log.txt

/sites/default/files/users/user1897files/Final error.txt

/sites/default/files/users/user1897files/Script.txt

GroG

6 years 10 months ago

In reply to by belizard

So, you should always use the MrlComm sketch which came with the myrobotlab.jar - if you don't things won't work correctly.  The MrlComm sketch is folder "in" myrobotlab.jar - and a ".jar" file is just a zip file - you can open it with 7-zip or Winzip or Linux unzip 

Also, try sending us a noWorky http://myrobotlab.org/content/helpful-myrobotlab-tips-and-tricks-0#noWo… .. it should be more easy for you than attaching files, and its better for us.

Cheers

It works after I used the MRL from the jar file. 

The problem was I could not install it from arduino module in the program.

In the future I will send no worky.

All good now, thank you very much !