This looks very good to me. And in opposite to the PropTool we even could write multiple small binaries into the (upper?) eeprom instead of one large eeprom image. interesting.
As far as I could find out the eeprom checksum is just used to for verifying the image before writing to eeprom. The prop bootloader does not check the checksum when booting from eeprom.
These two requests are quite powerful. And if they change the firmware to allow POST and GET we can add a similar GET request to read the eeprom. Nice.
This should be easy to implement into the editor. (famous last words) Need some refactoring work done anyways.
Now we just need to compile PropGCC with emscripten to javascript like @Heater did with OpenSpin.
But @Heater stated that this is clearly impossible. Or something along this line. And I was bound to find out - lately - that he is usually right.
I currently add P2 PASM keywords to the Editor. Lets see if I can extend @PhilPi's SPIN highlighter. (or what is left of it after me slaughtering it...)
This looks very good to me. And in opposite to the PropTool we even could write multiple small binaries into the (upper?) eeprom instead of one large eeprom image. interesting.
As far as I could find out the eeprom checksum is just used to for verifying the image before writing to eeprom. The prop bootloader does not check the checksum when booting from eeprom.
These two requests are quite powerful. And if they change the firmware to allow POST and GET we can add a similar GET request to read the eeprom. Nice.
This should be easy to implement into the editor. (famous last words) Need some refactoring work done anyways.
Now we just need to compile PropGCC with emscripten to javascript like @Heater did with OpenSpin.
But @Heater stated that this is clearly impossible. Or something along this line. And I was bound to find out - lately - that he is usually right.
I currently add P2 PASM keywords to the Editor. Lets see if I can extend @PhilPi's SPIN highlighter. (or what is left of it after me slaughtering it...)
Enjoy!
Mike
It's possible that GET will work with the current firmware like PUT. I haven't tried it yet so I can't say for sure though. I plan to add GET /eeprom/<addr>/<count> next though.
Since I do not own any S6B someone else need to test this.
@David is my best hope, so the IP of his S6B is default.
To test this, open Editor16 above. ... open some file out of the Library or other Demos - or - upload one of your own projects.
File - Upload New Local Files(s) - can upload more then one file. All selected files will be uploaded and opened.
click compile binary.
click 'Send to S6B'
''Load S6B' should run the loaded binary.
you need to have David's setup to test this with the S6B.
late here, I am tired.
Enjoy!
Mike
I will try to test this tonight. I'm traveling until the end of the week but I brought my ActivityBoard with me as well as a Wi-Fi router so if I can get all of that working in my hotel I'll try running your code.
Thanks for adding support for my HTTP loader!
Also, if someone from Parallax is reading this maybe it would be possible to supply you with a S6B module. Do you have a Propeller board that has an Xbee socket? You're certainly doing a lot of useful work and deserve some support!
I will try to test this tonight. I'm traveling until the end of the week but I brought my ActivityBoard with me as well as a Wi-Fi router so if I can get all of that working in my hotel I'll try running your code.
Thanks for adding support for my HTTP loader!
Also, if someone from Parallax is reading this maybe it would be possible to supply you with a S6B module. Do you have a Propeller board that has an Xbee socket? You're certainly doing a lot of useful work and deserve some support!
Well, my router seems to work in my hotel room but for some reason I can't build the default branch of propgcc and I need some of the i2c updates I did for the server. I'll try your code if I can get my build working and let you know how it goes. Sorry for the delay!
if you click either send to s6b or load s6b it will pop up a alert/confirm box. just correct ip there.
Enjoy!
Mike
Hmm.
Here is a transaction log on the server for loading from David's xbee-load program: The program runs of course.
sh-3.1$ make serve
Propeller Version 1 on COM52
Loading xbee-server.elf to hub memory
15240 bytes sent
Verifying RAM ... OK
[ Entering terminal mode. Type ESC or Control-C to exit. ]
Starting frame driver
Listening for frames
IP Address: 192.168.1.103
Request: PUT /eeprom/32768 HTTP/1.1
Response: HTTP/1.1 200 OK
Request: PUT /eeprom/33280 HTTP/1.1
Response: HTTP/1.1 200 OK
Request: PUT /load/32768/740 HTTP/1.1
load: 8000 740
Response: HTTP/1.1 200 OK
Here is a log using the HTTP loader. The program fails to run.
sh-3.1$ make serve
Propeller Version 1 on COM52
Loading xbee-server.elf to hub memory
15240 bytes sent
Verifying RAM ... OK
[ Entering terminal mode. Type ESC or Control-C to exit. ]
Starting frame driver
Listening for frames
IP Address: 192.168.1.103
Request: PUT /eeprom/32768 HTTP/1.1
Response: HTTP/1.1 200 OK
Request: PUT /eeprom/33280 HTTP/1.1
Response: HTTP/1.1 200 OK
Other observations:
Loading the server to EEPROM and rebooting gives listening on IP Address 0.0.0.0. Loading with "make serve" "works."
I am quite annoyed that I can't get editor16.htm to compile anything on my web server. What does it take?
Not sure why anyone needs to give a fully qualified html address for the loader ;-) The IP address should be sufficient.
looking at the transaction log you just hit 'send to s6b' after doing that you need to hit 'load s6b' also.
I can just see the first two requests, sending two chunks of bytes.
'load s6b' should send the third request PUT /load/32768/740 HTTP/1.1
I am quite annoyed that I can't get editor16.htm to compile anything on my web server. What does it take?
you are confusing me. I even can unzip this to my hard drive and just open the htm file in IE. Chrome want to run this from a webserver, IE does local file system also.
This is just htm and JavaScript and does not need anything on the server.
Except you want to save files. Then you need to enable PUT requests.
Editor16.htm, openspin.js editorww.js and s6b.js have to be in the same directory.
not sure what you mean by 'fully qualified'. I just took the ip/port combination out of Davids source.
You can surely omit :80 but leaving of http:// fails for me in windows. And having the / on the end is needed because I do not check for a missing one when putting the requests together.
You do not even need to install it on your server. just use the online one I provided. Since after loading from the server this runs in your browser, it does not matter.
As long as your browser can reach your local webserver it should work anyways.
can you post the content of the green console window?
edit:
Chrome does not run this from a local file system. Runs fine from a web server. It looks to me as if it does not find the Editorww.js.
What server you are running this on? I use wndows erver, is it may be a problem with case in the filenames? My windows server would not care, but mac/Linux do...
/edit
Why are two buttons required to test the loader?
Since I do not have a SB6 I did not install any of this and just looked thru the source.
IMHO this are 2 different functions.
In theory you can load multiple binaries at different addresses into the eeprom. The PUT /eeprom/xxx request provides the ability thru setting the start address before loading. It is not done like this in Davids loader, but that is just a command line switch away.
And the load request can then load one or another image, provided with start address and size.
So you can run a image without uploading it again.
I do certainly plan to daisy chain this. like click 'compile, burn and run' or something along that line.
I do have a activity board, but it MAY be one of the faulty ones from the first batch. Never did anything with it, beside using it as power source for my 3 spinnerets...
I guess I need to order one of those WIFI modules to test things here...
Editor16 won't run from local files. Chrome has a security complaint:
Uncaught SecurityError: Failed to construct 'Worker': Script at '[URL="file:///home/michael/Downloads/Editor16/Editorww.js"]file:///home/heater/Downloads/Editor16/Editorww.js[/URL]' cannot be accessed from origin 'null'.
Runs fine from the server connection though.
No time to play. I have an Expo to go to in Amsterdam.
For some reason when I first load the page there are no buttons labeled "S6B". This morning when I tried it I saw the buttons after compiling the Spin program. When I tried to load my Propeller board I got the following output and no indication that the Propeller had ever received anything:
2014-03-26 07:18:24 . execute s6bww.js - send_s6b
2014-03-26 07:18:25 w Send SB6 Worker started - consoleID: 2
2014-03-26 07:18:25 w root: http://10.70.158.145:80/
2014-03-26 07:18:25 w filesize: 92
2014-03-26 07:18:25 w chunkSize: 512
2014-03-26 07:18:25 w eepromOffset: 32768
2014-03-26 07:18:25 w delay: 500
2014-03-26 07:18:25 w sending 92 bytes from file 0 to eeprom 32768 - PUT http://10.70.158.145:80/eeprom/32768
2014-03-26 07:19:43 w Exception send_s6b: Error: NETWORK_ERR: XMLHttpRequest Exception 101
2014-03-26 07:19:43 w Exception send_s6b Stack: send@[native code]
@http://parallax.msrobots.net/s6bww.js:111
[native code]
2014-03-26 07:19:43 . Worker terminated itself correctly.
However, my xbee-load program isn't working either so I think the hotel network must be interfering in some way. I can't even ping the S6B module. I'll have to work on this over the weekend. Sorry!
Loading the server to EEPROM and rebooting gives listening on IP Address 0.0.0.0. Loading with "make serve" "works."
Ugh. That isn't right. I've never actually tried writing the loader program to EEPROM. I'll try that when I get back. The 0.0.0.0 address means that the DHCP request has failed to get an IP address. I'm not sure why that would happen when loading from EEPROM. Maybe there is a time delay needed somewhere.
That's odd. As I said, the server should be completely gone by the time your program starts so propeller-load should just be displaying output from your program. Maybe the shutdown isn't complete for some reason but it seems to work if I load C programs using xbee-load. I'll take a look at this when I get back to NH or when I figure out how to configure my router so it works in the hotel. I'm thinking I might just be able to turn off the NAT feature entirely and use it as a local Wi-Fi network. To do that I'll have to have a local copy of the web IDE though. How do I set that up?
That's odd. As I said, the server should be completely gone by the time your program starts so propeller-load should just be displaying output from your program. Maybe the shutdown isn't complete for some reason but it seems to work if I load C programs using xbee-load. I'll take a look at this when I get back to NH or when I figure out how to configure my router so it works in the hotel. I'm thinking I might just be able to turn off the NAT feature entirely and use it as a local Wi-Fi network. To do that I'll have to have a local copy of the web IDE though. How do I set that up?
Actually, I had done something really stupid in my code. It works. ... Except that now I'm having varying amounts of success getting the save and load transactions to work. Sometimes the load command doesn't reach the S6B loader server until I reboot the server. No idea why.
Saving @msrobots Editor16.zip to your Mac, and try running it with Safari. Safari and Chrome have a lot in common, so it may fail. That is, you may need to download Firefox.
Actually, I had done something really stupid in my code. It works. ... Except that now I'm having varying amounts of success getting the save and load transactions to work. Sometimes the load command doesn't reach the S6B loader server until I reboot the server. No idea why.
Saving @msrobots Editor16.zip to your Mac, and try running it with Safari. Safari and Chrome have a lot in common, so it may fail. That is, you may need to download Firefox.
You will have to reboot the HTTP server after each load sequence of course since starting the user program stops the server. This is something we'll have to address at some point. Maybe Jeff's scheme for sending an UDP packet to reset the ActivityBoard might work?
You will have to reboot the HTTP server after each load sequence of course since starting the user program stops the server.
To be clear.
1. Run server (make serve)
2. Send from webtool (server works)
3. Load from webtool (server works sometimes)
4. Run server (make serve) ... server sees Load if 3 didn't work.
The Hardware Flowcontrol and the "RTS" function can be used to send a reset by overflowing the buffer. Only RTS/CTS pins are brought out to a connection - another GPIO could be used though. The RTS function pin state is not controllable by the S6B yet. If a server COG could be left running and provide IO services, then that could be used to send a reset command. If the server COG goes down for some reason, then some other reset method is needed, so may as well figure out the hard reset method.
If you opened the Editor from a different domain as the files your webserver is delivering the webserver needs to support CORS.
If your webserver allows directory browsing you should be able to navigate the file system after opening a file from there.
1. Run server (make serve)
2. Send from webtool (server works)
3. Load from webtool (server works sometimes)
4. Run server (make serve) ... server sees Load if 3 didn't work.
Ugh. That's ugly. One thing I can tell you is that the /load/ request doesn't reliably return a response. I think this is because I shut down the server just before starting the user program. I may need to put a delay in there or somehow figure out if the response has been transmitted before shutting down.
The Hardware Flowcontrol and the "RTS" function can be used to send a reset by overflowing the buffer. Only RTS/CTS pins are brought out to a connection - another GPIO could be used though. The RTS function pin state is not controllable by the S6B yet. If a server COG could be left running and provide IO services, then that could be used to send a reset command. If the server COG goes down for some reason, then some other reset method is needed, so may as well figure out the hard reset method.
If you leave the server running it will tie up three (or two if we turn off RTS support) pins in addition to a COG.
How do I setup to run the web IDE locally? Is that possible? I need to go off the internet to connect to my ActivityBoard while I'm at the hotel so I need the web IDE files to be local to my Mac if I'm going to do any testing. What do I have to do to set this up?
unzip Editorxx.zip to some folder
create a folder /Library/ in the root of the same drive
copy all files from the Library folder of the proptool to your folder..
close all instances of chrome and start chrome as described here: http://www.chrome-allow-file-access-from-file.com/
This will allow chrome to access local files and therefore also it own webworker... You can then start the Editor from a local file system instead of a webserver.
Then the editor should be able to load needed files from the Library.
OR - if you do not need the PropTool library files - just Upload ALL files you need to compile and have them open in a Editor tab.
Menu File -> Upload local File(s). Then select all files needed and click OK to upload and open all at one click
The buttons and menu entries for the S6B are just usable if you have a compiled file open as active tab. (Green window)
Comments
PUT /eeprom/<addr>
PUT /load/<addr>/<length>
This seems to work with my S6B. Notice that I didn't have to resort to "XPUT" in this case. I guess it's just "POST" that the S6B eats.
I've pushed these changes to github. Thanks to msrobots for the suggestion!
Yes it is possible.
Worked fine for me. It's all here: ABS Wifi Demo
The client source is here: ABS Wifi Demo Page Source
The server source is here: ABS Wifi Demo Server
It was demo'd at Parallax Jan 23.
Now that David has PUT working it doesn't matter.
This looks very good to me. And in opposite to the PropTool we even could write multiple small binaries into the (upper?) eeprom instead of one large eeprom image. interesting.
As far as I could find out the eeprom checksum is just used to for verifying the image before writing to eeprom. The prop bootloader does not check the checksum when booting from eeprom.
These two requests are quite powerful. And if they change the firmware to allow POST and GET we can add a similar GET request to read the eeprom. Nice.
This should be easy to implement into the editor. (famous last words) Need some refactoring work done anyways.
Now we just need to compile PropGCC with emscripten to javascript like @Heater did with OpenSpin.
But @Heater stated that this is clearly impossible. Or something along this line. And I was bound to find out - lately - that he is usually right.
I currently add P2 PASM keywords to the Editor. Lets see if I can extend @PhilPi's SPIN highlighter. (or what is left of it after me slaughtering it...)
Enjoy!
Mike
No PASM2 yet. But - hopefully - support for S6B.
I attach it now and will install the attached Editor16.zip on my server.
just wait for next post.
This JavaScript stuff is FUN. Thanks @Heater...
Enjoy!
Mike
So here Is the link for testing http://parallax.msrobots.net/Editor16.htm
I decided that accessing the S6B is - like calling OpenSpin - outside of the primary goal of the Editor.
So it got its own webworker. here is the source. 140 lines.. see http://parallax.msrobots.net/Editor16.htm?a=http://parallax.msrobots.net/s6bww.js
Since I do not own any S6B someone else need to test this.
@David is my best hope, so the IP of his S6B is default.
To test this, open Editor16 above. ... open some file out of the Library or other Demos - or - upload one of your own projects.
File - Upload New Local Files(s) - can upload more then one file. All selected files will be uploaded and opened.
click compile binary.
click 'Send to S6B'
''Load S6B' should run the loaded binary.
you need to have David's setup to test this with the S6B.
late here, I am tired.
Enjoy!
Mike
I will try to test this tonight. I'm traveling until the end of the week but I brought my ActivityBoard with me as well as a Wi-Fi router so if I can get all of that working in my hotel I'll try running your code.
Thanks for adding support for my HTTP loader!
Also, if someone from Parallax is reading this maybe it would be possible to supply you with a S6B module. Do you have a Propeller board that has an Xbee socket? You're certainly doing a lot of useful work and deserve some support!
Enjoy!
Mike
Hmm.
Here is a transaction log on the server for loading from David's xbee-load program: The program runs of course.
Here is a log using the HTTP loader. The program fails to run.
Other observations:
Loading the server to EEPROM and rebooting gives listening on IP Address 0.0.0.0. Loading with "make serve" "works."
I am quite annoyed that I can't get editor16.htm to compile anything on my web server. What does it take?
Not sure why anyone needs to give a fully qualified html address for the loader ;-) The IP address should be sufficient.
looking at the transaction log you just hit 'send to s6b' after doing that you need to hit 'load s6b' also.
I can just see the first two requests, sending two chunks of bytes.
'load s6b' should send the third request PUT /load/32768/740 HTTP/1.1
you are confusing me. I even can unzip this to my hard drive and just open the htm file in IE. Chrome want to run this from a webserver, IE does local file system also.
This is just htm and JavaScript and does not need anything on the server.
Except you want to save files. Then you need to enable PUT requests.
Editor16.htm, openspin.js editorww.js and s6b.js have to be in the same directory.
not sure what you mean by 'fully qualified'. I just took the ip/port combination out of Davids source.
You can surely omit :80 but leaving of http:// fails for me in windows. And having the / on the end is needed because I do not check for a missing one when putting the requests together.
You do not even need to install it on your server. just use the online one I provided. Since after loading from the server this runs in your browser, it does not matter.
As long as your browser can reach your local webserver it should work anyways.
can you post the content of the green console window?
Enjoy!
Mike
Big retro green console window says.
edit:
Chrome does not run this from a local file system. Runs fine from a web server. It looks to me as if it does not find the Editorww.js.
What server you are running this on? I use wndows erver, is it may be a problem with case in the filenames? My windows server would not care, but mac/Linux do...
/edit
Since I do not have a SB6 I did not install any of this and just looked thru the source.
IMHO this are 2 different functions.
In theory you can load multiple binaries at different addresses into the eeprom. The PUT /eeprom/xxx request provides the ability thru setting the start address before loading. It is not done like this in Davids loader, but that is just a command line switch away.
And the load request can then load one or another image, provided with start address and size.
So you can run a image without uploading it again.
I do certainly plan to daisy chain this. like click 'compile, burn and run' or something along that line.
I do have a activity board, but it MAY be one of the faulty ones from the first batch. Never did anything with it, beside using it as power source for my 3 spinnerets...
I guess I need to order one of those WIFI modules to test things here...
Enjoy!
Mike
Uncaught SecurityError: Failed to construct 'Worker': Script at '[URL="file:///home/michael/Downloads/Editor16/Editorww.js"]file:///home/heater/Downloads/Editor16/Editorww.js[/URL]' cannot be accessed from origin 'null'.
Runs fine from the server connection though.
No time to play. I have an Expo to go to in Amsterdam.
Enjoy!
Mike
as stated before Chrome will not load the webworker from a local file system unless you force it with some command line switch.
IE does.
Be careful if somebody offers you cookies in Amsterdam ...
Enjoy!
Mike
Ok, I was able to run a 740 byte propeller program using the webtool on the S6B.
I'll test bigger programs with VGA on my propeller-boe later.
There is a problem with text output on the server, so I turned that off.
Maybe the 2 button load solution can be hidden but enabled from a menu.
My server is linux.
David let me know if you want working code that doesn't need propeller-gcc updated. ;-)
What kind of problem were you having with server output? The server shouldn't even be running anymore once the user's program is started.
Prints tons of garbage instead of "Hello Spin"
Program:
Actually, I had done something really stupid in my code. It works. ... Except that now I'm having varying amounts of success getting the save and load transactions to work. Sometimes the load command doesn't reach the S6B loader server until I reboot the server. No idea why.
Saving @msrobots Editor16.zip to your Mac, and try running it with Safari. Safari and Chrome have a lot in common, so it may fail. That is, you may need to download Firefox.
To be clear.
1. Run server (make serve)
2. Send from webtool (server works)
3. Load from webtool (server works sometimes)
4. Run server (make serve) ... server sees Load if 3 didn't work.
The Hardware Flowcontrol and the "RTS" function can be used to send a reset by overflowing the buffer. Only RTS/CTS pins are brought out to a connection - another GPIO could be used though. The RTS function pin state is not controllable by the S6B yet. If a server COG could be left running and provide IO services, then that could be used to send a reset command. If the server COG goes down for some reason, then some other reset method is needed, so may as well figure out the hard reset method.
Here Is a link explaining the Issue with Chrome and local files http://www.chrome-allow-file-access-from-file.com/
If you do that you can use your own Libray files. While searching for a file needed for compilation the Editor looks at
a) the same place your source file was opened from
b) same root as above but folder /Library/
c) http://parallax.msrobots.net/Library/
If you opened the Editor from a different domain as the files your webserver is delivering the webserver needs to support CORS.
If your webserver allows directory browsing you should be able to navigate the file system after opening a file from there.
Enjoy!
Mike
Thanks,
David
But this should work.
unzip Editorxx.zip to some folder
create a folder /Library/ in the root of the same drive
copy all files from the Library folder of the proptool to your folder..
close all instances of chrome and start chrome as described here: http://www.chrome-allow-file-access-from-file.com/
This will allow chrome to access local files and therefore also it own webworker... You can then start the Editor from a local file system instead of a webserver.
Then the editor should be able to load needed files from the Library.
OR - if you do not need the PropTool library files - just Upload ALL files you need to compile and have them open in a Editor tab.
Menu File -> Upload local File(s). Then select all files needed and click OK to upload and open all at one click
The buttons and menu entries for the S6B are just usable if you have a compiled file open as active tab. (Green window)
Enjoy!
Mike