Setting up environment:
To sum up:
- Download Arduino IDE. Latest as of now is 1.8.5.
- In Arduino IDE open File->Preferences, and change "Sketchbook location" to some unique folder just for OHS.
- Download from my GitHub gateway and libraries. Extract them to your newly created folder from step 2.
- Gateway uses ATmega1284p, that is not included in standard Arduino Boards Manager. The instruction how to add the board into your Arduino IDE can be found here. Basically just download the zip, and extract its content in /arduino-1.8.5//hardware folder. Use following board to compile sketch "Mighty 1284p 16MHz using Optiboot".
- Gateway uses different Ethernet library, delete the original Ethernet folder from /arduino-1.8.5/libraries and from /arduino-1.8.5/hardware/mighty-1284p/avr/libraries. We will be using only the one found in my libraries you've downloaded.
- Open /arduino-1.8.5/hardware/arduino/avr/cores/arduino/HardwareSerial0.cpp and change following line:
#if defined(_HAVE_HWSERIAL0)This is needed because Serial0 is somehow hard-coded into core and we need private library for GSM on port Serial0.
Now all is needed to open main_board.ino and try to compile it. All assembled boards come with Arduino bootloader and with latest firmware. They are also fully tested. When you plug a FTDI USB to serial programmer into gateway you can upload your changes directly to board.
- Gateway, all libraries required are included. Be aware that I have sometimes included small change in common libraries like Ethernet or Webserver, and all those are required to compile the sketch.
- Code for nodes is also stored on GitHub as single sketches depending on hardware version and accompanied fetaures.