|
1 | 1 | # my_sensor_app: Apache Mynewt Sensor Network Application for STM32 Blue Pill with ESP8266 and nRF24L01 (includes Geolocation) |
2 | 2 |
|
3 | | -The program runs in 4 modes: |
| 3 | +This C program runs in 4 modes, as described in [_Build Your IoT Sensor Network — STM32 Blue Pill + nRF24L01 + ESP8266 + Apache Mynewt + thethings.io_](https://medium.com/@ly.lee/build-your-iot-sensor-network-stm32-blue-pill-nrf24l01-esp8266-apache-mynewt-thethings-io-ca7486523f5d) |
4 | 4 |
|
5 | 5 | <b>1️⃣ Standalone Node (Blue Pill with ESP8266):</b> The program polls the |
6 | 6 | Blue Pill internal temperature sensor every 10 seconds and transmits the |
7 | 7 | sensor data (JSON format) to a CoAP (UDP) Server, such as thethings.io. |
8 | 8 |
|
9 | | -Edit the settings in `targets/bluepill_my_sensor/syscfg.yml` as follows: |
10 | | - |
11 | | -```yml |
12 | | -syscfg.vals: |
13 | | - # TUTORIAL1: 1 |
14 | | - TUTORIAL2: 1 |
15 | | - # TUTORIAL3: 1 |
16 | | - ... |
17 | | -``` |
18 | | - |
19 | 9 | <b>2️⃣ Sensor Node (Blue Pill with nRF24L01):</b> The program polls the |
20 | 10 | Blue Pill internal temperature sensor every 10 seconds and transmits the |
21 | 11 | sensor data (CBOR format) to the Collector Node. |
22 | 12 |
|
23 | | -Edit the settings |
24 | | -in `targets/bluepill_my_sensor/syscfg.yml` as follows: |
25 | | - |
26 | | -```yml |
27 | | -syscfg.vals: |
28 | | - # TUTORIAL1: 1 |
29 | | - # TUTORIAL2: 1 |
30 | | - TUTORIAL3: 1 |
31 | | - ... |
32 | | -``` |
33 | | - |
34 | | -Set `SENSOR_NODE_HW_ID_1` to the Hardware ID of the Blue Pill. |
35 | | - |
36 | 13 | <b>3️⃣ Collector Node (Blue Pill with nRF24L01 and ESP8266):</b> The program |
37 | 14 | receives sensor data (CBOR format) from the Sensor Node, and transmits the |
38 | 15 | sensor data (JSON format) to a CoAP (UDP) Server, such as thethings.io. |
39 | 16 |
|
40 | | -Edit the settings in `targets/bluepill_my_sensor/syscfg.yml` as follows: |
41 | | - |
42 | | -```yml |
43 | | -syscfg.vals: |
44 | | - # TUTORIAL1: 1 |
45 | | - # TUTORIAL2: 1 |
46 | | - TUTORIAL3: 1 |
47 | | - ... |
48 | | -``` |
49 | | - |
50 | | -Set `COLLECTOR_NODE_HW_ID` to the Hardware ID of the Blue Pill. |
51 | | - |
52 | 17 | <b>4️⃣ WiFi Geolocation (Blue Pill with ESP8266):</b> The program sends WiFi Access Point MAC Addresses and Signal Strength scanned by ESP8266 to a CoAP (UDP) Server, such as thethings.io. See https://github.com/lupyuen/thethingsio-wifi-geolocation |
53 | 18 |
|
54 | | -thethings.io will call the Google Geolocation API to compute the latitude and longitude based on the WiFi data. For public display, the computed geolocation is pushed to a web application hosted on Google Cloud App Engine. See https://github.com/lupyuen/gcloud-wifi-geolocation |
55 | | - |
56 | | -Edit the settings in `targets/bluepill_my_sensor/syscfg.yml` as follows: |
57 | | - |
58 | | -```yml |
59 | | -syscfg.vals: |
60 | | - # TUTORIAL1: 1 |
61 | | - TUTORIAL2: 1 |
62 | | - # TUTORIAL3: 1 |
63 | | - WIFI_GEOLOCATION: 1 |
64 | | - ... |
65 | | -``` |
66 | | - |
67 | | -# Patch for `vsscanf.c` |
| 19 | +The C application code in this folder is no longer in use, except `stub.c` and `vsscanf.c`. The application has been ported to Rust in [`/src`](/src) |
| 20 | + |
| 21 | +C:\stm32bluepill-mynewt-sensor\apps\my_sensor_app\.gitignore |
| 22 | +C:\stm32bluepill-mynewt-sensor\apps\my_sensor_app\OLDsrc |
| 23 | +C:\stm32bluepill-mynewt-sensor\apps\my_sensor_app\pkg.yml |
| 24 | +C:\stm32bluepill-mynewt-sensor\apps\my_sensor_app\README.md |
| 25 | +C:\stm32bluepill-mynewt-sensor\apps\my_sensor_app\src |
| 26 | +C:\stm32bluepill-mynewt-sensor\apps\my_sensor_app\syscfg.yml |
| 27 | +C:\stm32bluepill-mynewt-sensor\apps\my_sensor_app\test |
| 28 | +C:\stm32bluepill-mynewt-sensor\apps\my_sensor_app\OLDsrc\geolocate.c |
| 29 | +C:\stm32bluepill-mynewt-sensor\apps\my_sensor_app\OLDsrc\geolocate.h |
| 30 | +C:\stm32bluepill-mynewt-sensor\apps\my_sensor_app\OLDsrc\listen_sensor.c |
| 31 | +C:\stm32bluepill-mynewt-sensor\apps\my_sensor_app\OLDsrc\listen_sensor.h |
| 32 | +C:\stm32bluepill-mynewt-sensor\apps\my_sensor_app\OLDsrc\main.c |
| 33 | +C:\stm32bluepill-mynewt-sensor\apps\my_sensor_app\OLDsrc\send_coap.c |
| 34 | +C:\stm32bluepill-mynewt-sensor\apps\my_sensor_app\OLDsrc\send_coap.h |
| 35 | +C:\stm32bluepill-mynewt-sensor\apps\my_sensor_app\src\stub.c |
| 36 | +C:\stm32bluepill-mynewt-sensor\apps\my_sensor_app\src\vsscanf.c |
| 37 | +C:\stm32bluepill-mynewt-sensor\apps\my_sensor_app\test\README.md |
| 38 | +C:\stm32bluepill-mynewt-sensor\apps\my_sensor_app\test\src |
| 39 | +C:\stm32bluepill-mynewt-sensor\apps\my_sensor_app\test\src\test_hmac_prng.c |
| 40 | +C:\stm32bluepill-mynewt-sensor\apps\my_sensor_app\test\src\test_semihosting_console.c |
| 41 | +C:\stm32bluepill-mynewt-sensor\apps\my_sensor_app\test\src\test_temp_stm32.c |
| 42 | + |
| 43 | +## Patch for `vsscanf.c` |
68 | 44 |
|
69 | 45 | Note that we are using a patched version of `apps/my_sensor_app/src/vsscanf.c` that |
70 | 46 | fixes ESP8266 response parsing bugs. The patched file must be present in that location. |
0 commit comments