After coming across Espruino and really liking what it had to offer, I was able to convince my team that a port to our hardware could be a really beneficial endeavor. I started work on doing the port, and roped in a team member who helped me get some of the more nuanced things working, such as the SDIO FS usage.
Bit of a primer Janus RC is an M2M company that I work for, we offer fully certified devices for usage on various networks, through the use of Telit brand modems. While not always in the expense range of the maker type of project, we take care of the massive front end costs that accompany network certification, such as PTCRB. Our plug in devices are more akin to what users here would look for. This particular port is for our T2 Terminus, which is an STM32F4 powered device.
@Gordon - If you have any issues with my documentation/naming schemes of things, just let me know.
On to the fun stuff
Enough with the wordy preamble. You want code/examples, and you shall have them!
We've written some modules that can be used as building blocks for an M2M/cellular application, leaning on the modem's stack to handle basically everything you'd want. Although they are geared for Telit modems, you could simply tool the flow to fit your modem of choice... many basic AT commands overlap as standard (+CREG, for example). The primary goal is autonomous applications since that's what M2M is really all about.
This is my first Javascript based project, so I'm sure that I've done many things that many not be well executed, or take full advantage of what's available. Criticisms are of course welcome.
I won't re-write everything here, as I tried to document usage well in our github with a downloadable user guide. For those who don't want to use that .doc version, I tried to mirror it all in our forum, located here.
Our current modules and code include:
-Modem
AT Handling to interface to any modem that uses the standard Hayes format (\r\n terminated).
Network registration and checks
SMS sending and reception
Socket control
4a. Socket Dial to remote host
4b. Socket Listen for a remote client
4c. Socket Listen for remote client, with remote control of the console.
-Other
BMA222 Accelerometer
Some LED PWM fun
A note about the AT handler:
AT Command handler, uses an iterative approach to commands since Espruino currently cannot do something like "send AT command, wait for response" in a single loop. It must return to idle state for backend processing of the received data. This will likely improve later with a more streamlined approach. For now, you simply send the command twice to fetch the response.
>RunApp(TestProgram)
=undefined
Running T2 Test Program
**Running T2 Modem Wakeup App**
-->Modem On, checking for AT
-->AT Found, Modem Is Ready
**Running T2 Network Status App**
-->Modem Type: HE910
-->SIM Ready
-->SIM Phone Number: "1815xxxxxxx"
-->Modem Registered
-->Signal Quality: +CSQ: 16,3
-->Modem Ready for Data
-->Registered to: "Family Mobile"
-->Modem Firmware: 12.00.006
-->Network Status Check Complete.
Test Program Finished.
>
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
After coming across Espruino and really liking what it had to offer, I was able to convince my team that a port to our hardware could be a really beneficial endeavor. I started work on doing the port, and roped in a team member who helped me get some of the more nuanced things working, such as the SDIO FS usage.
Bit of a primer
Janus RC is an M2M company that I work for, we offer fully certified devices for usage on various networks, through the use of Telit brand modems. While not always in the expense range of the maker type of project, we take care of the massive front end costs that accompany network certification, such as PTCRB. Our plug in devices are more akin to what users here would look for. This particular port is for our T2 Terminus, which is an STM32F4 powered device.
@Gordon - If you have any issues with my documentation/naming schemes of things, just let me know.
On to the fun stuff
Enough with the wordy preamble. You want code/examples, and you shall have them!
We've written some modules that can be used as building blocks for an M2M/cellular application, leaning on the modem's stack to handle basically everything you'd want. Although they are geared for Telit modems, you could simply tool the flow to fit your modem of choice... many basic AT commands overlap as standard (+CREG, for example). The primary goal is autonomous applications since that's what M2M is really all about.
This is my first Javascript based project, so I'm sure that I've done many things that many not be well executed, or take full advantage of what's available. Criticisms are of course welcome.
Our current repository for this fork:
https://github.com/JanusRC/T2-Terminus/tree/master/espruinoT2/Janus_JS
I won't re-write everything here, as I tried to document usage well in our github with a downloadable user guide. For those who don't want to use that .doc version, I tried to mirror it all in our forum, located here.
Our current modules and code include:
-Modem
4a. Socket Dial to remote host
4b. Socket Listen for a remote client
4c. Socket Listen for remote client, with remote control of the console.
-Other
A note about the AT handler:
AT Command handler, uses an iterative approach to commands since Espruino currently cannot do something like "send AT command, wait for response" in a single loop. It must return to idle state for backend processing of the received data. This will likely improve later with a more streamlined approach. For now, you simply send the command twice to fetch the response.
Example AT send/receive:
Example registration demo: