Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions boot.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,19 @@
import time

print("\n\nBooting Albis Sensor")
pycom.heartbeat(False)
if debug:
pycom.rgbled(0xff0000)
time.sleep_ms(500)

if pycom.wifi_on_boot(): # get the wifi on boot flag
pycom.wifi_on_boot(False) # disable WiFi on boot

with open("config.json", 'r') as cf:
conf = ujson.loads(cf.read())
pycom.heartbeat(False)
if conf['debug']:
pycom.rgbled(0xff0000)
time.sleep_ms(500)
if conf['wifi'] is True:
import wifi
wifi.connect(conf['config']['wifi'])
wifi.connect(conf)
print("Connection done.")

machine.main('main.py')
48 changes: 36 additions & 12 deletions config.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,41 @@
{
"sensorid": "00caa13a17df11e881ac0800273cbaca",
"sensorid": "b2c8e788425611e8a4730800273cbaca",
"server": "http://istsos.org/istsos/wa/istsos/services/albis/operations/fastinsert",
"debug": true,
"wifi": true,
"read_cnt": 5,
"deepsleep_seconds": 1,
"debug": false,
"wifi": false,
"lora": true,
"board": "shield",
"deepsleep_shield": false,
"read_cnt": 2,
"deepsleep_seconds": 1800,
"type": {
"pysense": {
"temp1": "P22",
"temp2": "P21"
},
"shield": {
"temp1": "P22",
"temp2": "P21",
"scl": "P9",
"sda": "P10",
"batt": "P16"
}
},
"config": {
"wifi": {
"ssid": "CBMST",
"password": "xxxxxxxxxxxxxxxxxxxxxxx"
"password": "xxxxxxxxxxxxxxxxx"
},
"lora": {
"key": "notsuchsecretkey",
"deviceId": 100
}
},
"observations": [
[
"urn:ogc:def:parameter:x-istsos:1.0:internal:temperature",
"internal:temperature"
],
[
"urn:ogc:def:parameter:x-istsos:1.0:internal:air:humidity",
"internal:air:humidity"
Expand All @@ -21,12 +45,8 @@
"internal:pressure"
],
[
"urn:ogc:def:parameter:x-istsos:1.0:internal:lux:blue",
"internal:lux:blue"
],
[
"urn:ogc:def:parameter:x-istsos:1.0:internal:lux:red",
"internal:lux:red"
"urn:ogc:def:parameter:x-istsos:1.0:internal:lux",
"internal:lux"
],
[
"urn:ogc:def:parameter:x-istsos:1.0:external:wall:temperature",
Expand All @@ -35,6 +55,10 @@
[
"urn:ogc:def:parameter:x-istsos:1.0:external:water:temperature",
"external:water:temperature"
],
[
"urn:ogc:def:parameter:x-istsos:1.0:sensor:battery",
"sensor:battery"
]
]
}
146 changes: 0 additions & 146 deletions lib/LIS2HH12.py

This file was deleted.

70 changes: 0 additions & 70 deletions lib/LTR329ALS01.py

This file was deleted.

Loading