Software for low-power IoT sensors (like Arduino) with SIM900 module support, tested on Arduino Uno.
Features following:
- multitasking capability on bare atmega328/P processor (Arduino compatible)
- GSM support tested on SIM900
- simple encryption (beware - the current algorithm is quite simple to break, you may want to alter it - see ymessage.c)
- allows development and debugging under Windows (tested with VS 2017 community edition) and compilation for Arduino (CMake project)
- scripting (not used right now) based on uBasic
To build under Windows please open the VS2017 solution. In order to build for Arduino please follow Arduino build - howto.txt.
Before the build you need to rename secrets.h.example to secrets.h and fill gateway url, incuding port (see Arctic Panther) and encryption key (must match the gateway).
This project incorporates code from pt and uBasic projects, so their licenses apply.
The hardware used is Arduino Mini Pro 5V, with following connections: A0 - input to the resistor defining the type of the device (resistor between +5V and A0) A1 - input to the data signal from the sensor D5 - output pin - has +5V when sensor is being used, 0V when idle, used to switch power to sensor D6 - output pin - +5V when modem is used, 0V when idle, used to switch power to the modem
I powered the Arduino from +9V battery pack trough the buck converter. Additionaly I cut off LEDs from Arduino as they eat quite a lot of power (see Making An Ultra Low Power Arduino Pro for details).
The project compiles and runs on Windows as well as on Arduino. On Windows, the microcontroller’s hardware is emulated and most of the code uses API provided in the "arch" directory. Windows implementation uses the SIM900 emulator, where Arduino one needs to have the real device connected.
The provided ArcticPanther.SLN allows for development on Visual Studio Community Edition 2017.
Unit tests do not fit into Arduino memory, so they need to be enabled manually (look into tests.h file and uncomment necessary definitions).
Open ArcticPanther.sln. Compile for x86 (64 bit is not tested).
If VS throws an error related to the SDK simply follow its advice and re-target.
- Install arduino 1.0.5 - newer versions may not work correctly and were not tested (older versios might be obtained from https://www.arduino.cc/en/main/OldSoftwareReleases)
- Install MinGW on c:\mingw
- Run configure.bat, and:
- Use "build" subdirectory as a place to build
- Click "Configure"
- Specify MinGW Make as a build system
- Click "Specify toolchain file for cross-compiling", pick toolchain/ArduinoToolchain.cmake
- Click configure && build
- Execute make.bat
If you have any issues or errors during configuration please remove the cache re-run cmake-gui.