All about CavyIoT-DevBoard
Click here to download pdf
CavyIoT.nodemcu-V0.03.bin firmware converts your hardware (NodeMCU, ESP8266 and WeMos D1 R1) to CavyIoT-DevBoard
Firmware is released as free open source, for the developers by Cavy Agrotronics. This firmware is useful to engineering students, teachers, hobbyist, enthusiast, programmers, for availing CavyIOT services. This firmware is free for all who want to add the power of IoT in their product.
It is language independent, means no matters what programming language the user is using in his project. User can interface CavyIoT Development Board with simple Send-Response protocol.
Flashing firmware converts IC ESP8266 into CavyIoT Development Board (CavyIoT-DevBoard). Developer of any community can develop and deploy a powerful IoT system/application to the end user. Simple interfacing API architecture makes easier for developers in development process.
Hardware-
Software-
The CavyIoT service provides the subscriber access to CavyIoT-DevBoard all over the internet anytime/anywhere via Control Panel Control Panel is standard GUI software accessible over internet using standard internet browser.
Pin mapping of NodeMCU after flashing firmware.
CavyIoT-DevBoard’s baud rate is 9600 and is fixed for serial communication (via rx , tx pins). CavyIoT-DevBoard recognize a line of Instruction when is send within enclosed chevrons followed by a carriage return. Device sends request to the CavyIoT server via internet, in defined interval to get the status of Control Panel, for an example if the user clicks the button on control panel, the device will receive control signal issued in the next ping (request). The pinging keeps the device in synchronization with the Control Panel. Default ping interval is 5 sec, setting ping interval to higher values slows the response time of device and vice versa . And sensor data sent to CavyIoT-DevBoard is get displayed on Control Panel for monitoring and processing.
The Output Pins of CavyIoT-DevBoard shown above are responsive to the corresponding Buttons on the Control Panel. The frequency of sending sensor data to server and the frequency of receiving control signal from Control Panel of device, depends upon ping interval and it is configurable. User can set Ping Interval via programming device or from the Control Panel.
In Dev-Board there is inbuilt provision for keeping records of the all operations and state of device. It keeps the record of records all data, operations and status of the device. As you know, the output pins of DevBoard are responsive to the corresponding Buttons on the Control Panel. If the button is clicked on Control Panel causes the state of output pin of device get changed or if user switches operation mode ie from AUTO to MANUAL causes a change in status of device. This change in operation mode or the change in state of output pin generates an event to write record to the end of log file in DevBoards memory. Even if any such event does not occurs the device records the state of device in predefined interval. Local data backup is the most important as it is useful for data analysis, and for tracing the track of operation done. Recording interval is configurable and can be set from Control Panel too!
Keep the data-backup pin B (shown in above image) LOW and restart the device.This will create a Wi-Fi hotspot to serve a page to download data log file. The default Wi-Fi ssid is CavyIoT and password admin@123. Browse to url http://100.100.100.100 where the page with link for download will be available by local Wi-Fi web server of device. User can set Hotspot parameters (SSID, password) for his privilege, with the help of hardware API.
(CavyIoT-DevBoard is abbreviated as device for our convenience)
The basic interface is to send device a line of Instruction within enclosed chevrons-
<ShowDemo(WiFiSSID, WiFiPassword, CavyIoT-username,CavyIoT-password, Device-name)>
then wait for the proper response message with open chevrons (>) followed by ok! or error!( >ok! or >Error!) . This signals device has completed the parsing and executed the command. At times, CavyIoT-DevBoard may not respond immediately. This happens when device is busy doing something else mostly happened with
<ShowDemo()>
The response messages are strings terminated by a return. These messages are "pushed" from device to the user in response to a query or instruction to let the user what happened.
The primary way to talk to device is performed by sending it a command string of characters (Instruction within enclosed chevrons < >), followed by a carriage return. Device will then process the string and then reply back with a response message, also terminated by a return, to tell you how it went.
Streaming Protocol: Simple Send-Response [Recommended]
The send-response streaming protocol is the most fool-proof and simplest method to stream a command to device. The host PC/ MCU interface simply sends a line of command to CavyIoT-DevBoard and waits for an Ok! or Error! Response message before sending the next line of command.
So, no matter if device needs to wait for room in the look-ahead planner buffer to finish parsing and executing the last line of command or if the the host computer is busy doing something, this guarantees both to the host PC /MCU and device, the programmed command has been sent and received properly.
(Note : All commands for CavyIoT-DevBoard are not Case Sensitive! )
DefineButtonLables
Syntax-
<DefineButtonLables(Label (0), Action1, Action2, Label (1), Action1, Action2, Label (2), Action1, Action2, Label (3), Action1, Action2)>
Description-
Sets the Label for Button(index) and Labels for the its actions.
Button when is in Action1 OUTPUT Pin(index) is LOW
Button when is in Action2 OUTPUT Pin(index) is HIGH
Default-
Button(n) | Label | Action1 | Action2 |
0 | LED1 | ON | OFF |
1 | LED2 | ON | OFF |
2 | LED3 | ON | OFF |
3 | LED4 | ON | OFF |
Response Message-
onSuccess-
onError-
StartDevice
Syntax-
<StartDevice( WiFiSSID, WiFiPassword, CavyIoT-username, password, device)>
Description-
Connects to the Wi-Fi and starts pinging with regular interval.
Default-
no defaults
Response Message-
onSuccess-
onError-
Ping Response Message-
onSuccess-
onError-
UpdateSensorData
Syntax-
<UpdateSensorData(Sensor1, S1_Value, S1_Unit, Sensor2, S2_Value, S2_Unit, Sensor3, S3_Value, S3_Unit, Sensor4, S4_Value, S4_Unit)>
Description-
Sends data to the server.
Default-
no defaults
Response Message-
onSuccess-
onError-
Example-
<UpdateSensorData( Temperature, 35.12, C, humidity, 19.00, Rh, Speed, 16.00, km/hr, pressure, 4.12, Psi)>
Response Message-
onSuccess-
onError-
SetPingInterval
Syntax-
<SetPingInterval(seconds)>
Description-
Sets the Ping Interval.
Default-
5
Response Message-
onSuccess-
onError-
Example-
<SetPingInterval(10)>
Response Message-
onSuccess-
onError-
SetRecordingInterval
Syntax-
<SetRecordingInterval(minutes)>
Description-
Sets the Recording Interval.
Default-
5
Response Message-
onSuccess-
onError-
Example-
<SetRecordingInterval(5)>
Response Message-
onSuccess-
onError-
SetBackupHotspot
Syntax-
<SetBackupHotspot(Hotspot_name, Hotspot_password)>
Description-
Sets the Wi-Fi Hotspot credentials for data backup
Default-
Hotspot_name- CavyIoT
Hotspot_password- admin@123
Response Message-
onSuccess-
onError-
Example-
<SetBackupHotspot(BlueSky, jki125nmio)>
Response Message-
onSuccess-
onError-
ShowDemo
Syntax-
<ShowDemo(WiFiSSID, WiFiPassword, CavyIoT-username, password, device)>
Description-
Connects to the Wi-Fi and starts pinging. And returns Device Status after each ping.
Default-
no defaults
Response Message-
onSuccess-
onError-
Example-
<ShowDemo(BlueSky, jki125nmio, robert555, oltrtrtv45pA2@, Demo)>
Response Message-
onSuccess-
onError-
Step by step guide on how to flash firmware over the internet using arduino IDE
Using Example sketches in CavyIoTdevelopmentBoard.h you can flash firmware to ESP8266,NodeMCU or Wemos D1 R1. and library helps in communication between your hardware, CavyIoT Cloud and IoT Dashboard (Control Panel).
CavyIoTdevelopmentBoard.h library is available as a downloadable ZIP. Starting with Arduino IDE version 1.0.5, you can install 3rd party libraries in the IDE
CavyIoTdevelopmentBoard.h Library by clicking the button:
or Download it from GitHub GitHub
Do not unzip the downloaded library, leave as it is.
then select downloaded ZIP file and click 'Open'
The Library will be available to use in sketches, but with older IDE versions examples for the library will not be exposed in the File > Examples until after the IDE has restarted.
CavyIoT firmware converts your hardware (NodeMCU, ESP8266 and WeMos D1 R1) to CavyIoT-DevBoard
Then select board and COM port properly. (NodeMCU is selected in this example)
Congratulations! Your CavyIoT-DevBoard is ready to use.
<ShowDemo(WiFiSSID, WiFiPassword, CavyIoT-username,CavyIoT-password, Device-name)>
Replace Wi-FiSSID, Wi-Fi Password, CavyIoT username, Password and Device Name with your own credentials.
Now You can control this Dev-Board from anywhere,anytime! Log in to your account and operate Control Panel.
and try to..
Turn ON/OFF LED with the help of buttons.
Change the mode of operation (ie from 'AUTO' to 'MANUAL') and a lot.
You will see the output on serial monitor changes, the state of LED connected changes, and live charts and gauges for sensor data!
Step by step guide for intefacing with Arduino
Then select board and COM port properly. (Arduino-UNO is selected in this example)
Congratulations! Your Arduino UNO is successfully interfacing with CavyIoT-DevBoard.
Now Login and to to CavyIoT Control Panel and Enjoy CavyIoT!