Overview - Electric Imp Code

The imp is the small card with an SD Card form factor. Upon powering up, the imp contacts the cloud based Electric Imp server and checks for new software. If there is new software it downloads and runs it. If not, it runs its existing software. There are two components of software that are associated with each imp: the device software, which runs on the imp itself; and the agent software, which runs on the Electric Imp server in the cloud. The device code can interact with the hardware that the imp is connected to and it can communicate with the agent code. The agent code can communicate with the rest of the internet. Below is the agent and device code.

Agent and Device Code

Note that the agent code below is not exactly what is running for this class. It has been simplified to the code that you would run if you were building just one IOTemp. The code running for the class is provided further down the page. This code is more complicated because it allows us to assign each IOTemp to its own APEX Workspace. Also note that "your_ords_schema_goes_here" should be replaced with your workspace name in lower case. It is really the value shown in your workspace REST settings, which is typically your workspace name. As of this writing, it should always be lower case even though in the settings it is upper case.