Scripty no worky

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's picture

Hi ! what mrl version you are

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

Mats's picture

Magic number

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.

 

 

belizard's picture

Reply

Hi !

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

GroG's picture

Hello belizard ! Did you make

Hello belizard !
Did you make progress ?

belizard's picture

Reply

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's picture

So, you should always use the

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#noWorky .. it should be more easy for you than attaching files, and its better for us.

Cheers

belizard's picture

Thank you friend !

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 !