First time with Arduino - SOFT_RESET

Hi All,

This is the first time I have played with the Arduino Uno and things are not going well :-(

I create an Arduino object and copy the sketch to the Arduino IDE and  try to compile it, but I get a warning about SOFT_RESET being redefined - Is this something to worry about?

If I download the compiled sketch and try to connect to my Arduino some times I get a "goodtimes" message other times I don't.

When I add a servo to my Arduino Object and try to control it I get an error about the port not being open. I have tried a few turtorial which all seem pretty much the same, but I always end up in the same situation "did not get response from arduino" or "can not write to a closed port".

Could someone try and ponit me in the right direction please?

Andrew

MyRobotLab 1.0.119

GroG's picture

Hello and Welcome

Hello and Welcome Rekabuk,

The SOFT_RESET is less of a concern that the, "If I download the compiled sketch and try to connect to my Arduino some times I get a "goodtimes" message other times I don't."

A log file would help us - this can be done by sending a NoWorky

http://myrobotlab.org/content/helpful-myrobotlab-tips-and-tricks-0#noWorky

rekabuk's picture

No Worky

Thanks for the reply Grog - after sending the message I did send a noworky, but here  is the log file anyway.

Ummm.. Not sure how to add a log file to a post?

Andrew

rekabuk's picture

Restart

After a restart of everything I get "Bad Magic Number" followed by "getVersion no response".

I'm sure I am doing something silly :-(

GroG's picture

your noWorky looked pretty

your noWorky looked pretty strange...

You have run Arduino examples on this Arduino .. like the ever popular 'blink' ?

rekabuk's picture

Bad to worse :(

I tired blink and it didn't work. I think the IDE was having trouble programming the device. I am using Win7 64-bit and found a bit in trouble shooting about using the correct drivers for the UNO. I tried to update them and now programming is even worse - oops!

I'll Google the driver issue a bit more...

rekabuk's picture

Progress..

I installed the IDE on an XP machine and was able to program blink into my Arduino. So it seems I have an issue with the install of the ICE on my Win7 64-bit machine :(

GroG's picture

Ok that sounds like good

Ok that sounds like good progress..  Ya, you did a good job in finding a "simple" thing to work ..

Sometimes when its too complex, it's hard to tell where the problem is, but you ran blinky on mutiple platforms, and found an issue of it on Win 7..

We have run it on Win 7 before, so I don't know what the issue is, but more importantly, did you get further along on the XP box?  Did you get MRL running ?

rekabuk's picture

Slow progress - but it's progress none the less!

Hi GroG,

To be honest I have two kids under 2.5, so getting any chance to 'play' is very limited.

I have had not luck getting the Win7 machine to talk to the Arduino and I don't want to run MRL on the XP machine, both machines are also "work" machines.

I am currently looking to source another XP machine (or I might load Linux???) which I should get tomorrow then maybe I'll get a chance to install MRL on this machine on Wednesday and use it as a dedicated MRL/InMoov machine.

Meanwhile my InMoov head is sat on the bench motionless :(

Andrew

rekabuk's picture

OK, so I now have a machine

OK, so I now have a machine running Ubuntu 12.0.4 LTS 64-bit.

I finally got the mouse working!!!!

Downloaded th latest Arduino IDE and was able to program blink into my arduino.

I copied the code from MRL for InMoov head - compiled it and programmed into my Arduino Uno. (still get the SOFT_RESET warning)

Closed the IDE, opened MRL, set the head.arduino port to /dev/tty/AMC0 and I get a message "no response..." which is back where I was before (almost).

GroG, I sent a no-worky, perhaps you could take a look please?

Andrew

rekabuk's picture

serial leds

If I send the command getVersion, I see the Arduino RX and Tx LEDs flicker and MRL is reporting "bad magic number 0".

GroG's picture

Your log file looks

Your log file looks 'better'.

In a new directory can you download the 'latest' 

http://mrl-bucket-01.s3.amazonaws.com/current/develop/myrobotlab.jar

And give that a try - the Arduino MRLComm.ino changed since the version your currently using (119) so you'll need to re-load that in the Arduino IDE

So .

1. make new directory like /opt/mrl  - this is Ubuntu right?
2. download jar from link above
3. start mrl java -jar myrobotlab.jar
4. install all service (go get a cup of tea)
5. restart
6. start an Arduino service - within the arduino tab will be the new MRLComm.ino copy and paste into the Arduino IDE - upload it
7. connect on whatever port the arduino  /dev/ttyACM0 ... different flavors of Linux require different permission sets. I remember in the past a user had to be part of dialout group to work with tty stuff .. this changes all the time - usually the all powerful 'root' works the best..
8. send another no worky - if it no worky

Good Luck :) Remember you'll get it eventually .. one way or another

rekabuk's picture

When I "install all" I get a

When I "install all" I get a lot of errors like this:

 

:: downloading artifacts ::
     trying https://raw.githubusercontent.com/MyRobotLab/repo/develop/org.atmosphere...
        tried https://raw.githubusercontent.com/MyRobotLab/repo/develop/org.atmosphere...
downloading https://raw.githubusercontent.com/MyRobotLab/repo/develop/org.atmosphere... ...
    public-remote: downloading https://raw.githubusercontent.com/MyRobotLab/repo/develop/org.atmosphere...
        to /home/andrew/mrl/develop/repo/org.atmosphere.nettosphere/nettosphere/jars/geronimo-servlet_3.0_spec-1.0-2.3.0.jar.part
....... (94kB)
HTTP response status: 404 url=https://raw.githubusercontent.com/MyRobotLab/repo/develop/org.atmosphere.nettosphere/2.3.0/geronimo-servlet_3.0_spec-1.0.jar.sha1
CLIENT ERROR: Not Found url=https://raw.githubusercontent.com/MyRobotLab/repo/develop/org.atmosphere.nettosphere/2.3.0/geronimo-servlet_3.0_spec-1.0.jar.sha1
HTTP response status: 404 url=https://raw.githubusercontent.com/MyRobotLab/repo/develop/org.atmosphere.nettosphere/2.3.0/geronimo-servlet_3.0_spec-1.0.jar.md5
CLIENT ERROR: Not Found url=https://raw.githubusercontent.com/MyRobotLab/repo/develop/org.atmosphere.nettosphere/2.3.0/geronimo-servlet_3.0_spec-1.0.jar.md5
    [SUCCESSFUL ] org.atmosphere.nettosphere#nettosphere;2.3.0!geronimo-servlet_3.0_spec-1.0.jar (708ms)
     trying https://raw.githubusercontent.com/MyRobotLab/repo/develop/org.atmosphere...
        tried https://raw.githubusercontent.com/MyRobotLab/repo/develop/org.atmosphere...
downloading https://raw.githubusercontent.com/MyRobotLab/repo/develop/org.atmosphere... ...
    public-remote: downloading https://raw.githubusercontent.com/MyRobotLab/repo/develop/org.atmosphere...
        to /home/andrew/mrl/develop/repo/org.atmosphere.nettosphere/nettosphere/jars/javax.inject-1-2.3.0.jar.part
.. (2kB)
HTTP response status: 404 url=https://raw.githubusercontent.com/MyRobotLab/repo/develop/org.atmosphere.nettosphere/2.3.0/javax.inject-1.jar.sha1
CLIENT ERROR: Not Found url=https://raw.githubusercontent.com/MyRobotLab/repo/develop/org.atmosphere.nettosphere/2.3.0/javax.inject-1.jar.sha1
HTTP response status: 404 url=https://raw.githubusercontent.com/MyRobotLab/repo/develop/org.atmosphere.nettosphere/2.3.0/javax.inject-1.jar.md5
CLIENT ERROR: Not Found url=https://raw.githubusercontent.com/MyRobotLa

rekabuk's picture

publishMRLCommError/1

I now get the error above and everytime I send getVersion, I also get a red status bar on MRL saying "MRL->Arduino rx 110 type 1"

When I installed Arduino the first time it added me to the group "dialout". I then had to manually download version 1.6.7.

I'll send a no-worky.

Thanks for your patience,  I design FPGAs for GPS test applications as a living and I was thinking the 3D printing was going to be the hard part of InMoov, but it turns out it's the software that is the more trouble :-)

Andrew

GroG's picture

There are a lot of parts to

There are a lot of parts to InMoov - so potentially there are a lot of places where things could go wrong.
Some people have many issues with the software, some do not.   As long as your learning along the way, I would consider it worthwhile.

So - info #1 regarding the errors 

HTTP response status: 404 url=https://raw.githubusercontent.com/MyRobotLab/repo/develop/org.atmosphere.nettosphere/2.3.0/javax.inject-1.jar.sha1
CLIENT ERROR: Not Found 
 
This has to do with the fact we do not distribute sha1 or md5 files in our repo.   Typically they are used to verify the contents.  We have too few resources to maintain these files, but these errors are not problematic.
 
Now on to Arduino rx 110 type 1 - its a serial error and its hard to say why.
 
Did you get any errors when compiling / uploading the new MRLComm into the Uno ?
rekabuk's picture

Compile/Upload

No errors compiling - only warnings about some shift rights it didn't like. Uploading said it completed OK.

Andrew

 

home/andrew/Arduino/sketch_jan27a/sketch_jan27a.ino:177:0: warning: "SOFT_RESET" redefined [enabled by default]
 #define SOFT_RESET         253
 ^
/home/andrew/Arduino/sketch_jan27a/sketch_jan27a.ino:135:0: note: this is the location of the previous definition
 #define SOFT_RESET    45
 ^
/home/andrew/Arduino/sketch_jan27a/sketch_jan27a.ino: In function 'long unsigned int toUnsignedLong(unsigned char*, int)':
/home/andrew/Arduino/sketch_jan27a/sketch_jan27a.ino:429:33: warning: left shift count >= width of type [enabled by default]
   return ((buffer[start + 3] << 24) + (buffer[start + 2] << 16) + (buffer[start + 1] << 8) + buffer[start]);
                                 ^
/home/andrew/Arduino/sketch_jan27a/sketch_jan27a.ino:429:61: warning: left shift count >= width of type [enabled by default]
   return ((buffer[start + 3] << 24) + (buffer[start + 2] << 16) + (buffer[start + 1] << 8) + buffer[start]);
                                                             ^
/home/andrew/Arduino/sketch_jan27a/sketch_jan27a.ino: In function 'void loop()':
/home/andrew/Arduino/sketch_jan27a/sketch_jan27a.ino:738:36: warning: left shift count >= width of type [enabled by default]
         pin.target = ((ioCmd[2] << 24) + (ioCmd[3] << 16) + (ioCmd[4] << 8) + ioCmd[5]);
                                    ^
/home/andrew/Arduino/sketch_jan27a/sketch_jan27a.ino:738:55: warning: left shift count >= width of type [enabled by default]
         pin.target = ((ioCmd[2] << 24) + (ioCmd[3] << 16) + (ioCmd[4] << 8) + ioCmd[5]);
                                                       ^
 

rekabuk's picture

Sending getVersion returns this:

07:38:42.978 [tert.serial] ERROR c.myrobotlab.framework.Service - tert.serial error bad magic number 103
07:38:42.978 [gui] ERROR c.myrobotlab.framework.Service - gui error bad magic number 103
07:38:42.979 [tert.serial] ERROR c.myrobotlab.framework.Service - tert.serial error bad magic number 101
07:38:42.979 [tert.serial] ERROR c.myrobotlab.framework.Service - tert.serial error bad magic number 116
07:38:42.979 [tert.serial] ERROR c.myrobotlab.framework.Service - tert.serial error bad magic number 86
07:38:42.979 [tert.serial] ERROR c.myrobotlab.framework.Service - tert.serial error bad magic number 101
07:38:42.980 [tert.serial] ERROR c.myrobotlab.framework.Service - tert.serial error bad magic number 114
07:38:42.980 [tert.serial] ERROR c.myrobotlab.framework.Service - tert.serial error bad magic number 115
07:38:42.980 [tert.serial] ERROR c.myrobotlab.framework.Service - tert.serial error bad magic number 105
07:38:42.980 [tert.serial] ERROR c.myrobotlab.framework.Service - tert.serial error bad magic number 111
07:38:42.980 [tert.serial] ERROR c.myrobotlab.framework.Service - tert.serial error bad magic number 110
07:38:42.980 [tert.serial] ERROR c.myrobotlab.framework.Service - tert.serial error bad magic number 10
07:38:42.982 [AWT-EventQueue-0] INFO  c.myrobotlab.framework.Status - sent [getVersion
]
07:38:42.982 [gui] ERROR c.myrobotlab.framework.Service - gui error bad magic number 101
07:38:42.983 [gui] ERROR c.myrobotlab.framework.Service - gui error bad magic number 116
07:38:42.983 [/dev/ttyACM0.portListener 1] ERROR c.myrobotlab.framework.Service - tert error MRL->Arduino rx 12 type 1
07:38:42.985 [gui] ERROR c.myrobotlab.framework.Service - gui error bad magic number 86
07:38:42.986 [/dev/ttyACM0.portListener 1] ERROR c.myrobotlab.framework.Service - tert error MRL->Arduino rx 13 type 1
07:38:42.994 [/dev/ttyACM0.portListener 1] ERROR c.myrobotlab.framework.Service - tert error MRL->Arduino rx 14 type 1
07:38:42.995 [/dev/ttyACM0.portListener 1] ERROR c.myrobotlab.framework.Service - tert error MRL->Arduino rx 15 type 1
07:38:42.996 [/dev/ttyACM0.portListener 1] ERROR c.myrobotlab.framework.Service - tert error MRL->Arduino rx 16 type 1
07:38:42.996 [/dev/ttyACM0.portListener 1] ERROR c.myrobotlab.framework.Service - tert error MRL->Arduino rx 17 type 1
07:38:42.997 [/dev/ttyACM0.portListener 1] ERROR c.myrobotlab.framework.Service - tert error MRL->Arduino rx 18 type 1
07:38:42.998 [gui] ERROR c.myrobotlab.framework.Service - gui error bad magic number 101
07:38:42.999 [gui] ERROR c.myrobotlab.framework.Service - gui error bad magic number 114
07:38:42.999 [/dev/ttyACM0.portListener 1] ERROR c.myrobotlab.framework.Service - tert error MRL->Arduino rx 19 type 1
07:38:43.000 [/dev/ttyACM0.portListener 1] ERROR c.myrobotlab.framework.Service - tert error MRL->Arduino rx 20 type 1
07:38:43.000 [/dev/ttyACM0.portListener 1] ERROR c.myrobotlab.framework.Service - tert error MRL->Arduino rx 21 type 1
07:38:43.001 [gui] ERROR c.myrobotlab.framework.Service - gui error bad magic number 115
07:38:43.002 [/dev/ttyACM0.portListener 1] ERROR c.myrobotlab.framework.Service - tert error MRL->Arduino rx 22 type 1
07:38:43.003 [gui] ERROR c.myrobotlab.framework.Service - gui error bad magic number 105
07:38:43.006 [gui] ERROR c.myrobotlab.framework.Service - gui error bad magic number 111
07:38:43.010 [gui] ERROR c.myrobotlab.framework.Service - gui error bad magic number 110
07:38:43.012 [gui] ERROR c.myrobotlab.framework.Service - gui error bad magic number 10
07:39:11.590 [agent.timer] INFO  c.myrobotlab.framework.Status - task null running - next run 0:0:1:0

 

Do I need to set any special attributes on /dev/ttyACM0?

 

rekabuk's picture

Had to get the scope out :(

I had I look at the TX line on the Arduino-Uno with a scope while I sent getVersion from the MRL arduino.serial window.

The first byte sent back by the Arduinno is 0xAA, which I believe is the "magic number" 170, my MRL is often complaining that this is incorrect.

The transmitted burst is about 7.5ms long, but the getVersion response appears to be 4 bytes at 57600 which should be about 700us? Are the reties occuring in MRL? Maybe I really do not have the correct code loaded in my Arduino?

Still confused....

rekabuk's picture

Moving thread

I am starting a new thread as this one no longer matches the original title:

http://myrobotlab.org/content/ubuntu-and-arduino