Page 2 of 3

Re: Anyone see this before?

Posted: Sun Mar 10, 2013 11:35 am
by DrewPalmer04
I'm excited too! :)

Re: Anyone see this before?

Posted: Tue Mar 19, 2013 6:27 pm
by rimai
Ok, I was finally able to solder the boards and put them through the test.
I was able to have serial communication just fine with the xbee modems when set to 57600 baud, but was not successful in uploading codes to it when set to 115200 baud.
When I was testing at 57600 baud, I talked to the controller and requested the internal web server page and got responses just fine. So I confirmed I had two way communication just fine.
Then, I moved to 115200 baud, which is the speed that optiboot uses to communicate. When the upload process starts, I get some response back, but it stops and fails :(
This is what I got:

Code: Select all

The following features were automatically added:
Watchdog Timer
Version Menu

The following features were detected:
Simple Menu
Binary sketch size: 19,902 bytes (of a 32,256 byte maximum)
C:\Program Files (x86)\Reef Angel Controller\hardware/tools/avr/bin/avrdude -CC:\Program Files (x86)\Reef Angel Controller\hardware/tools/avr/etc/avrdude.conf -v -v -v -v -patmega328p -carduino -P\\.\COM3 -b115200 -D -Uflash:w:C:\Users\Owner\AppData\Local\Temp\build5872162785073746506.tmp\Template.cpp.hex:i 

avrdude: Version 6.0, compiled on Apr  6 2012 at 19:29:19
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2009 Joerg Wunsch

         System wide configuration file is "C:\Program Files (x86)\Reef Angel Controller\hardware/tools/avr/etc/avrdude.conf"

         Using Port                    : \\.\COM3
         Using Programmer              : arduino
         Overriding Baud Rate          : 115200
Rebooting Reef Angel Controller
avrdude: Send: 0 [30]   [20] 
avrdude: Send: 0 [30]   [20] 
avrdude: Send: 0 [30]   [20] 
avrdude: Recv: . [14] 
avrdude: Recv: . [10] 
         AVR Part                      : ATMEGA328P
         Chip Erase delay              : 9000 us
         PAGEL                         : PD7
         BS2                           : PC2
         RESET disposition             : dedicated
         RETRY pulse                   : SCK
         serial program mode           : yes
         parallel program mode         : yes
         Timeout                       : 200
         StabDelay                     : 100
         CmdexeDelay                   : 25
         SyncLoops                     : 32
         ByteDelay                     : 0
         PollIndex                     : 3
         PollValue                     : 0x53
         Memory Detail                 :

                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           eeprom        65    20     4    0 no       1024    4      0  3600  3600 0xff 0xff
                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           flash         65     6   128    0 yes     32768  128    256  4500  4500 0xff 0xff
                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           lfuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           hfuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           efuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           lock           0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           calibration    0     0     0    0 no          1    0      0     0     0 0x00 0x00
                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           signature      0     0     0    0 no          3    0      0     0     0 0x00 0x00

         Programmer Type : Arduino
         Description     : Arduino
avrdude: Send: A [41] . [80]   [20] 
avrdude: Recv: . [14] 
avrdude: Recv: . [03] 
avrdude: Recv: . [fc] 

avrdude: stk500_getparm(): (a) protocol error, expect=0x14, resp=0xfc
avrdude: Send: A [41] . [81]   [20] 
avrdude: Recv: . [14] 
avrdude: Recv: . [04] 
avrdude: Recv: . [10] 
avrdude: Send: A [41] . [82]   [20] 
avrdude: Recv: . [14] 
avrdude: Recv: . [fc] 
avrdude: Recv: 

avrdude: stk500_getparm(): (a) protocol error, expect=0x14, resp=0xfc
avrdude: Send: A [41] . [98]   [20] 
avrdude: Recv: 

avrdude: stk500_getparm(): (a) protocol error, expect=0x14, resp=0x41
         Hardware Version: 1984904986
         Firmware Version: 4.-2
avrdude: Send: A [41] . [84]   [20] 
avrdude: Recv: 

avrdude: stk500_getparm(): (a) protocol error, expect=0x14, resp=0x41
avrdude: Send: A [41] . [85]   [20] 
avrdude: Recv: 

avrdude: stk500_getparm(): (a) protocol error, expect=0x14, resp=0x41
avrdude: Send: A [41] . [86]   [20] 
avrdude: Recv: 

avrdude: stk500_getparm(): (a) protocol error, expect=0x14, resp=0x41
avrdude: Send: A [41] . [87]   [20] 
avrdude: Recv: 

avrdude: stk500_getparm(): (a) protocol error, expect=0x14, resp=0x41
avrdude: Send: A [41] . [89]   [20] 
avrdude: Recv: 

avrdude: stk500_getparm(): (a) protocol error, expect=0x14, resp=0x41
         Vtarget         : 3.2 V
         Varef           : 268590.0 V
         Oscillator      : 1.372 Hz
         SCK period      : 2153852453.4 us

avrdude: Send: A [41] . [81]   [20] 
avrdude: Recv: 

avrdude: stk500_getparm(): (a) protocol error, expect=0x14, resp=0x41
avrdude: Send: A [41] . [82]   [20] 
avrdude: Recv: 

avrdude: stk500_getparm(): (a) protocol error, expect=0x14, resp=0x41
avrdude: Send: B [42] . [86] . [00] . [00] . [01] . [01] . [01] . [01] . [03] . [ff] . [ff] . [ff] . [ff] . [00] . [80] . [04] . [00] . [00] . [00] . [80] . [00]   [20] 
avrdude: Recv: 
avrdude: stk500_initialize(): (a) protocol error, expect=0x14, resp=0x42
avrdude: initialization failed, rc=-1
         Double check connections and try again, or use -F to override
         this check.

avrdude: Send: Q [51]   [20] 
avrdude: Recv: 
avrdude: stk500_disable(): protocol error, expect=0x14, resp=0x51

avrdude done.  Thank you.

According to this, the first two bytes received are correct:

Code: Select all

avrdude: Recv: . [14] 
avrdude: Recv: . [10] 
This indicates the controller rebooted and accepted the byte to start the bootloader.
Then, the second sequence of bytes start and that's when things got corrupted...

Code: Select all

avrdude: Send: A [41] . [80]   [20] 
avrdude: Recv: . [14] 
avrdude: Recv: . [03] 
avrdude: Recv: . [fc] 

avrdude: stk500_getparm(): (a) protocol error, expect=0x14, resp=0xfc
avrdude sends 3 bytes: 41, 80 and 20 and the board was supposed to respond with 14,03 and 14.
But avrdude receives back 14,03 and fc and that's when avrdude quits saying there was a protocol error.
So, at this point, I'll need more time to investigate what is going on.
The quick google search I did led me to believe nobody was able to do this on the optiboot bootloader yet, except for one person or company, but they used a different modem.
It's called synapse RF100.
Here is the link that discouraged me:
http://arduino.cc/forum/index.php/topic,153565.0.html
This is the document I read about the RF100:
https://solarbotics.com/download.php?file=300

Re: Anyone see this before?

Posted: Tue Mar 19, 2013 7:18 pm
by DrewPalmer04
Darn! I didn't see the arduino article before. :(

BUT you can be the first to get them working :) lol at least it starts transmitting correctly!

Re: Anyone see this before?

Posted: Wed Mar 20, 2013 5:26 pm
by 00Warpig00
I may be missing something obvious here, but why not just push the upload at a slower speed? Is the 115200 a requirement? Id be happy to turn a 30 second upload to the controller into a minute long upload for the advantage of it being wireless. Even more so if I don't ever have to disconnect my Ethernet adapter again to do it :D Small price to pay in my eyes.

Nick

Re: Anyone see this before?

Posted: Wed Mar 20, 2013 5:29 pm
by DrewPalmer04
00Warpig00 wrote:I may be missing something obvious here, but why not just push the upload at a slower speed? Is the 115200 a requirement? Id be happy to turn a 30 second upload to the controller into a minute long upload for the advantage of it being wireless.

Nick
Crossed my mind as well.

Re: Anyone see this before?

Posted: Wed Mar 20, 2013 5:36 pm
by 00Warpig00
Hell, it takes me longer than the time difference would be just to find my 20 foot USB cable, drop it across the floor, and plug it in to both my RA and computer. lol :)

Nick

Re: Anyone see this before?

Posted: Wed Mar 20, 2013 5:44 pm
by rimai
With a different bootloader, yes

Re: Anyone see this before?

Posted: Fri Mar 29, 2013 9:06 pm
by rimai
I found out that the xbee radios are actually working on a different baud rate and that's probably why the data gets corrupted.
It is trying to communicate at 117647 instead of 115200 :(

Re: Anyone see this before?

Posted: Sat Mar 30, 2013 5:26 am
by DrewPalmer04
Maybe a software or hardware mod could fix that

Re: Anyone see this before?

Posted: Sat Mar 30, 2013 10:46 am
by rimai
I think we need one of these:
http://www.dfrobot.com/index.php?route= ... Vck0KPn-70
They claim it works on our bootloader

Re: Anyone see this before?

Posted: Sat Mar 30, 2013 11:06 am
by Piper
Wouldn't we need the whole kit?

http://www.dfrobot.com/index.php?route= ... VcolFeQO9I

Well, I'm guessing you would need everything but the IO expansion shield. In place of that you would need a board for the 2nd WPN to plug into the pins on the RA, yes? or is there a way to plug that in under the hood? If we plug into the pins that means we still have to unlug the wifi to program.

~Charlie

Re: Anyone see this before?

Posted: Sun Mar 31, 2013 8:58 pm
by rimai
Ok, after the failed attempt to use the xbee, I decided to revisit my first choice of upload without wires.
My first attempt a while ago was unsuccessful and the module sat in the shelf for quite a while.
So, I decided to put another effort in tying to find out why I failed last time and this is what I got it this time:
[youtube]http://www.youtube.com/watch?v=mi3d2EjXSqk[/youtube]
This is the first step into getting it this completed.
The next step is trying to integrate the wifi as well as the bluetooth radio.
Right now, the code fails to upload if the wifi is connect too, so I'll have to come up with a way to isolate the wifi when we are uploading.
More to come :ugeek:

Re: Anyone see this before?

Posted: Mon Apr 01, 2013 7:30 am
by lnevo
Sweet. So we'll be able to connect via bluetooth :) Then maybe I can go back to developing on my Mac

Re: Anyone see this before?

Posted: Mon Apr 01, 2013 10:08 am
by Piper
That's awesome! Even through my RA is less that 10' away from my computer I'll still pick one of these modules up when they become available. That would be awesome being able to upload a small change without stringing out the USB cable and disconnecting the wifi.

~Charlie

Re: Anyone see this before?

Posted: Sat Apr 20, 2013 7:51 pm
by rimai
Ok, so I figured out the way to coexist both modules and isolate the channels, so they don't get each others' transmissions.
My proto board looks ugly with lots of wires, but it does the job :)
Check it out:
[youtube]http://www.youtube.com/watch?v=q59IwQ0o4BY[/youtube]

Re: Anyone see this before?

Posted: Sat Apr 20, 2013 9:07 pm
by DrewPalmer04
Great success! Congrats! This will be a great expansion for RA users

Re: Anyone see this before?

Posted: Sun Apr 21, 2013 6:17 am
by cosmith71
This is awesome! Pricing and availability estimates?

--Colin

Re: Anyone see this before?

Posted: Wed Apr 24, 2013 8:10 am
by Piper
So are they ready yet???

:)

Re: Anyone see this before?

Posted: Sun Apr 28, 2013 11:22 pm
by jtomasi
Would the BT work with the RA client

Re: Anyone see this before?

Posted: Mon Apr 29, 2013 8:05 am
by rimai
Yes :)

Re: Anyone see this before?

Posted: Thu May 02, 2013 3:10 pm
by Poiromaniax
This is awesome - congrats man!

To be honest when i first recieved my RA i thought the wifi module alone could do this :P

Re: Anyone see this before?

Posted: Fri May 03, 2013 6:58 am
by lnevo

Re: Anyone see this before?

Posted: Fri May 03, 2013 8:35 am
by rimai
Very nice :)
I wish we could see the spark cloud working to see if we can add out libraries :(

Re: Anyone see this before?

Posted: Fri May 03, 2013 11:07 am
by enigma32
That's pretty slick.
I've been thinking about picking up an arm dev board of some kind; had been waiting for the Leaf Labs "Oak", which seems on hold now, but then thinking about the Leaf Labs "Maple", but maybe I'll look into this Spark Cloud board now... :-)

Re: Anyone see this before?

Posted: Fri May 03, 2013 11:26 am
by DrewPalmer04
Very interesting. Could we (as RA) figure out how to do a firmware update type thing? Sending a file over the wifi connection , store on SD (RA side) decomplie and program like a flash? Not sure if this method would be better versus trying to upload small bits of data over and over via wifi??? Isnt this where our issue lays? If an SD (or other storage) could receive the flash file then upload we wouldn't be dealing with the small bits of data right?

I could be way off??? I don't have the components to mess with this at the moment :(

Re: Anyone see this before?

Posted: Sat May 18, 2013 4:59 pm
by paulvisco
Hey Roberto have you had any time to play with this

Also can you cobble a drawing together that shows the wifi and bt connected

I have just recived a new bt module and would love to play with this..

Not so much the wireless programing but the xfer aspect of it BT would be a great way to connect fo ra control while in the house.. VS having to pull the laptop out each time i want to check on things

http://dx.com/p/jy-mcu-arduino-bluetoot ... ule-104299

is the module i picked up

Re: Anyone see this before?

Posted: Sat May 18, 2013 5:12 pm
by rimai
I've had problems using those cheap BT adapters for programming, but it worked fine for data xfer.
Simply connect Tx/Rx from RA to TX/RX of the BT module. Simple as that :)
Just make sure you connect over 57600 baud.
I've got the first prototype done yesterday and installed on my RA for remote programming. It worked out pretty nice :)
I just need to make one small revision and produce a new prototype to finalize the pcb design.

Re: Anyone see this before?

Posted: Sat May 18, 2013 5:26 pm
by paulvisco
Cool.. Ya cheap is not always a good thing as we have talked about before.. i will try it later tonigh and see if i can get my data back from it...

What BT did you use for testing

Re: Anyone see this before?

Posted: Sat May 18, 2013 5:28 pm
by rimai
Looks the same. I think there is a 5 and a 6 version and I tried both of them. Could only get data.
It would freeze when I tried using it for programming.

Re: Anyone see this before?

Posted: Sat May 18, 2013 5:31 pm
by paulvisco
Ya they have a 3-10 versions they all look pretty close to each other.. Ok any who.. i will keep playing thats what it is all about anyways...

I may be one of the few people that own a ra that has not used it to control my tank im having way too much fun on the programing and just the understanding of how it works,,,

Total Love the RA