What can I do with a Parallax WX Module
iseries
Posts: 1,492
in Accessories
Rather than deal with the formatting of this site I decided to just produce a PDF with the information.
In putting this information together I used the following C program compile with simpleIDE as LMM otherwise it will drop some of the data that will be received. I used the exclamation point, !, to signal the start of a command. For example: !CHECK:wifi-mode would send 0xfeCHECK:wifi-mode. You could change it to some other character as well.
#include "simpletools.h" #include "fdserial.h" #define Rx 14 #define Tx 13 #define TRx 31 #define TTx 30 unsigned char C; fdserial *cnn; fdserial *trm; int main() { unsigned char L; simpleterm_close(); trm = fdserial_open(TRx, TTx, FDSERIAL_MODE_NONE, 115200); cnn = fdserial_open(Rx, Tx, FDSERIAL_MODE_NONE, 115200); fdserial_txChar(trm, '>'); pause(1000); fdserial_txChar(trm, '>'); while(1) { if (fdserial_rxReady(cnn)>0) { C = fdserial_rxChar(cnn); if ((C > 'z') || (C < ' ')) { dprint(trm, "<%2.2x>", C); if (C == '\r') fdserial_txChar(trm, C); } else fdserial_txChar(trm, C); if (C == '~') { dprint(trm, "Recv:"); dprint(cnn, "%cARG:5,WORLD\r", 0xfe); dprint(cnn, "%cREPLY:5,200,8,8\r", 0xfe); dprint(cnn, "Whatever"); } } if (fdserial_rxReady(trm)>0) { C = fdserial_rxChar(trm); if (C == '!') { fdserial_txChar(cnn, 0xfe); } else fdserial_txChar(cnn, C); // if (C == 0x0d) // fdserial_txChar(cnn, 0x0a); } } }
This is my setup but other should work as well.
Here is the PDF with the different commands that can be used with the unit. The instruction do not assume any programming language.
The UDP example require the latest version of the firmware.
Mike
pdf
365K
Comments
iseries,
Thank you very much.
Excellent documentation, well explained and presented.
I hope in time others will enhance your work by posting and cross-referencing actual code snippets for some of the functions described in your paper.
This is excellent, and I hope more can be created!
Some may seem redundant for those who know how to use the api for the wx module...
But the little extras like the http session client requests are nice to see examples for.
, but speaking for myself, I am a slow moron who eats cookies, so even more examples with detailed info helps, i forget everything!
I will give udp transfers a try, once I rewrite my serial synchronous receive method.
(I do serial flushes so, i guess the command events could be flushed with them.)
I have links to the older 1.0, and 1.2, firmware in my thread, I will eventually have the latest one put there(I took it down due to crashing issues)
I think a few more bug fixes still need to be committed to the parallax repo, they may be waiting for testing?
Once those are available I will make the latest firmware available on that thread, compiling the firmware is not easy at all.
The OTA file is available in the zips, that should make upgrading easy for most, and the v1.0 and v1.2 are there also to downgrade if you want.
https://forums.parallax.com/discussion/comment/1505814/#Comment_1505814