Skip to content

Commit 742d4dd

Browse files
committed
Adding sensor app readme
1 parent 35d4e23 commit 742d4dd

File tree

2 files changed

+28
-50
lines changed

2 files changed

+28
-50
lines changed

apps/my_sensor_app/README.md

Lines changed: 26 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,70 +1,46 @@
11
# my_sensor_app: Apache Mynewt Sensor Network Application for STM32 Blue Pill with ESP8266 and nRF24L01 (includes Geolocation)
22

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)
44

55
<b>1️⃣ Standalone Node (Blue Pill with ESP8266):</b> The program polls the
66
Blue Pill internal temperature sensor every 10 seconds and transmits the
77
sensor data (JSON format) to a CoAP (UDP) Server, such as thethings.io.
88

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-
199
<b>2️⃣ Sensor Node (Blue Pill with nRF24L01):</b> The program polls the
2010
Blue Pill internal temperature sensor every 10 seconds and transmits the
2111
sensor data (CBOR format) to the Collector Node.
2212

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-
3613
<b>3️⃣ Collector Node (Blue Pill with nRF24L01 and ESP8266):</b> The program
3714
receives sensor data (CBOR format) from the Sensor Node, and transmits the
3815
sensor data (JSON format) to a CoAP (UDP) Server, such as thethings.io.
3916

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-
5217
<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
5318

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`
6844

6945
Note that we are using a patched version of `apps/my_sensor_app/src/vsscanf.c` that
7046
fixes ESP8266 response parsing bugs. The patched file must be present in that location.

src/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ This Rust application polls the internal temperature sensor every 10 seconds and
44

55
The application is compiled as a Rust library `libmylib.rlib`, which is injected into the Mynewt build.
66

7+
The application was ported from the C version at [`/apps/my_sensor_app`](/apps/my_sensor_app)
8+
79
[`lib.rs`](lib.rs): Main library module. Contains `main()`, called by Mynewt at startup, and the panic handler. Imports the modules below via the `mod` directive.
810

911
[`base.rs`](base.rs): Common declarations

0 commit comments

Comments
 (0)