View Full Version : managing SPY uploads
korda
11-04-2008, 03:53 PM
In case client program needs to upload new SPY scripts to all remotes and bridge, what the sequence of events should be?
I have tried following (simplified version):
- BeginAddSpy - load file for a remote
- BeginAddSpy - load file for a bridge
- BeginUploadSpy - upload file to a bridge
- BeginUploadSpy - upload to each remote, one by one.
I have used snapystick for a bridge and the SPY upload fails and after that everything else useless.
Should the bridge be the last node to upgrade or completely separate upgrade function?
kbanks
11-04-2008, 05:15 PM
Adding the SPY files before you upload them is correct.
You could also choose to add one SPY file, then upload it, then add the next SPY file, then upload it. The important thing is that you have to do each add before you have a SPY file that can be uploaded.
When uploading multiple nodes: yes, your bridge should be uploaded last. This is because it will be rebooted at the end of the upload.
As for your SNAPstick problems... are you loading a script into the SNAPstick that PREVENTS it from being able to talk afterwards? This is not the same as an "upload failure".
The most common cause of this is people not realizing that the USB interface is UART1 on a SNAPstick, but it is UART0 on a Synapse "bridge" node.
You can't take a "bridge" script and use it in a SNAPstick without first accounting for the change in UARTs.
korda
11-04-2008, 08:26 PM
The most common cause of this is people not realizing that the USB interface is UART1 on a SNAPstick, but it is UART0 on a Synapse "bridge" node.
You can't take a "bridge" script and use it in a SNAPstick without first accounting for the change in UARTs.
Kevin, my bridge script does not initialize and use any UARTS.
We do not alter any default radio factory settings in the script.
I do not understand why we cannot take bridge script and use it on Snapstick? I do realize that factory default port for USB/RS232 comm is UART1. But why would this affect our bridge script or stops communication after script upload?
mgenti
11-05-2008, 09:45 AM
I just retested uploading a SPY file in 2.1.19 to my SNAP stick and it worked successfully. I have attached to this email the SPY file I used if you would like to try it. Once loaded it should blink the LED green.
korda
11-05-2008, 02:39 PM
Mark,
I have made my client code to upload SPY files in this sequence:
- load node file (proxy.BeginAddSpy(sSpyNodeFile, data, AddCallback))
- load bridge file (proxy.BeginAddSpy(sSpyBridgeFile, dataB, AddCallback))
- upload node 1 (proxy.BeginUploadSpy(new byte[] { b1,b2,b3},
sSpyNodeFile,
UploadCallback);)
- on UploadCallback() upload node N, same as above except mac...
- on UploadCallback(), when all nodes are finished, upload to bridge:
proxy.BeginUploadSpy(new byte[] { b1,b2,b3},
sSpyBridgeFile,
UploadCallback);
I get "Upload Succeeded" every time.
Then Bridge locks up with D2 on Snapystick solid ON. This is happened even with your "stick_flasher.spy"
To recover - I have to move bridge node to another board and erase script.
mgenti
11-05-2008, 02:55 PM
What results do you get when uploading to the bridge node with the original C# client example?
korda
11-05-2008, 03:45 PM
I just tried to upload one SPY to bridge and it works with demo C# client.
It is the same code I use in my client, except that I load two different files, one after another and then uploading them.
korda
11-05-2008, 08:56 PM
I split SPY upgrade in two different functions (Bridge and Nodes) and the problem with Bridge lockup went away. Must be a bug in my client code. Thanks for help.
vBulletin® v3.8.0, Copyright ©2000-2012, Jelsoft Enterprises Ltd.