Be notified of new releases
Create your free GitHub account today to subscribe to this repository for new releases and build software alongside 28 million developers.Sign up
In order to cross compile the RPS application on the Ubuntu 14 development host for the Raspberry Pi, the cURL library suited for the RPi has been copied onto the dev host. The RPS project within Eclipse has been configured to make use of the library.
Apart from a new configuration in Eclipse, the code hasn't changed. This new configuration cross compiles the C code for the Raspberry Pi B+ board.
It has been developed on an Ubuntu 14 computer and is designed to run on any Linux computer with the cURL library installed.
What's missing is the software driver for the general purpose input/output port (hardware interface). That module will be added once it's been decided on what hardware platform (Raspberry Pi or Beaglebone) the application will finally run.
AJAX calls have been added to the browser code, and the server code has been adapted where necessary.
Changes applied to the source code (cosmetic changes aren't listed):
- Change the name of the form field from 'Password' to 'Device Identifier' - this makes the purpose of the field clearer
- In the ON and OFF buttons: remove the calls to the modal dialogs - they aren't used anymore
- Remove implementation of the modal dialogs - they aren't used anymore
- Remove method="post" from <form> element - it isn't required anymore
- Change name="password" to name="devId" in the form's element - adapt its name to its purpose
- Add onclick="buttonClicked(this)" to <button> elements
- Add jQuery function $(document).ready() - it executes after the DOM has been generated
- Improve the function set() such that it only updates the database if the requested new state isn't equal to the current state.
- Add 2nd remote power switch with identifier '2' to improve testability
The JSON files in the data folder initialize the database with the device identifier (devId) 1. This is an example identifier for usage on the local host. It may not be suited well for the WWW.
Use the following commands inside Postman to
- Get or set the state of the Remote Control Switch (the one that is set by the embedded computer and read by the browser)
- Get or set the state of the client side switch (the one that is set by the browser and read by the embedded computer).
Set/get the state of the Remote Control Switch (set by the embedded computer, read by the browser):
Set/get the state of the client side switch (set by the browser, read by the embedded computer):
Intermediate release related to blog post https://bitcontrol.ch/en/2015/11/19/iot-remote-power-switch-part-5/.
This release is related to the blog post https://bitcontrol.ch/en/2015/11/05/iot-remote-power-switch-part-4/.