Once I used RasPi/Arduino for IoT prototyping, ending up with unsatisfying results: complicated physical wiring problems.
So I started thinking of a combination of PIC16F1-based sensor network and Android to simplify physical wiring.
This is a framework for developing IoT applications on Android supporting dynamic feature enhancements:
CLI is also positioned as a main UI to launch other activities (plug-in etc).
Sensor network simulator is provided for debugging applications on Android w/o a physical sensor network.
I use EventBus to support messaging among components within the application on Android.
My smartphone is equipped with built-in sensors. I add a sensor network to my smart phone to add other sensors.
Sensor | Built-in | Add-on |
---|---|---|
Three-axis Accelerometer | Y | Y |
Speed (hall sensor) | N | Y |
Orientation sensor | Y | N |
Magnetic sensor | Y | N |
Temperature | N | Y |
Humidity | N | Y |
GPS | Y | N |
At the moment, modify strings.xml manually to replace the current plug-in with another one:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- Edge computing plug-in -->
<!-- Cycling -->
<string name="edge_computing_plugin">jp.araobp.iot.edge_computing.plugin.cycling.Cycling</string>
<string name="edge_computing_plugin_activity">jp.araobp.iot.edge_computing.plugin.cycling.CyclingActivity</string>
<string name="edge_computing_plugin_button_name">Cycling</string>
<!-- Template
<string name="edge_computing_plugin">jp.araobp.iot.edge_computing.plugin.template.Template</string>
<string name="edge_computing_plugin_activity">jp.araobp.iot.edge_computing.plugin.template.TemplateActivity</string>
<string name="edge_computing_plugin_button_name">Template</string>
-->
</resources>
In the future, I will add a more dynamic way to swap plug-in.
Again, modify strings.xml manually to enable/disable built-in sensors:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- Built-in sensors -->
<string name="enable_ambient_temperature">true</string>
<string name="enable_relative_humidity">true</string>
<string name="enable_accelerometer">false</string>
</resources>
I develop in-bicycle network using the output from sensor-network. It is like a cheap version of CANopen :-)
Since smartphone's USB port is occupied, connect adb to the smartphone via WiFi following the guide:
1. adb tcpip 5555
2. disconnect USB cable
3. adb connect <ip address of smartphone>:5555
4. adb logcat
Or use the sensor network simulator included in this repo