spectraphilic / wasp_sketches

Waspmote sketches develoded by our group
1 stars 0 forks source link

SD fail at start but work later #52

Closed ArcticSnow closed 5 years ago

ArcticSnow commented 5 years ago

A bug in our code get the SD card to be not recognized at startup, then unavailable from the interactive menu. Once the menu is exited, the SD cards behaves normally. See log:

J#
..SD.ON() failed flag=2
.
Time      : Thu, 19/02/14, 11:04:35
Id        : 623618FDC337DE6E Version=J Name=uw-xbee_test
Battery   : Lithium-ion (80 %)
Hardware  : board=lemming SD=0 GPS=1
XBee      : mac=0013A2004105D838 hw=184D sw=80730000 network="Pi UiO"
Frames    : size=73 encryption=disabled
Log       : level=DEBUG output=USB, SD
Actions   : net=20m bat=5m gps=10m acc=5m mb=5m bme=5m mlx=5m tmp=5m vl=5m 

Press Enter to start interactive mode. Wait 2 seconds to skip.
Timeout.

=== Binary Frame: 1 fields in 32 bytes ===
Frame type: 8
Serial ID: 0x623618FDC337DE6E
Waspmote ID: uw-xbee_test
Sequence: 0
Sensor 123 (TST): 1550142272
==========================================
1550142277.306 INFO Id        : 623618FDC337DE6E Version=J Name=uw-xbee_test
1550142277.316 INFO Battery   : Lithium-ion (80 %)
1550142277.324 INFO Hardware  : board=lemming SD=0 GPS=1
1550142277.333 INFO XBee      : mac=0013A2004105D838 hw=184D sw=80730000 network="Pi UiO"
1550142277.346 INFO Frames    : size=73 encryption=disabled
1550142277.354 INFO Log       : level=DEBUG output=USB, SD
1550142277.364 INFO Actions   : net=20m bat=5m gps=10m acc=5m mb=5m bme=5m mlx=5m tmp=5m vl=5m 
1550142277.377 INFO Boot done, go to sleep
1550142277.384 WARN saveTimeToSD: Opening TIME.TXT failed
1550142277.394 DEBUG Next alarm at 00:11:05:00 in 1 minutes
1550142300.865 INFO *** Loop 1 battery=Lithium-ion (80 %)
1550142300.925 INFO ACC x=-4, y=54, z=958
1550142301.004 DEBUG BME280 Temperature: 6.76 Celsius Degrees
1550142301.027 DEBUG BME280 Humidity   : 68.55 %RH
1550142301.057 DEBUG BME280 Pressure   : 101214.58 Pa
1550142301.083 DEBUG MLX 90614 object=5.58
1550142301.115 DEBUG MLX 90614 ambient=7.25
1550142301.140 DEBUG TMP102 6.75 Celsius
1550142301.245 DEBUG Distance 0 (mm): 497
1550142301.269 DEBUG Distance 1 (mm): 497
1550142301.293 DEBUG Distance 2 (mm): 497
1550142301.317 DEBUG Distance 3 (mm): 497
1550142301.339 DEBUG Distance 4 (mm): 679
1550142301.364 DEBUG Distance 5 (mm): 679
1550142301.388 DEBUG Distance 6 (mm): 679
1550142301.413 DEBUG Distance 7 (mm): 679
1550142301.444 DEBUG Distance 8 (mm): 1000
1550142301.467 DEBUG Distance 9 (mm): 1000
1550142301.489 DEBUG Distance 10 (mm): 1000
1550142301.515 DEBUG Distance 11 (mm): 1498
1550142301.538 DEBUG Distance 12 (mm): 1498
1550142301.563 DEBUG Distance 13 (mm): 1498
1550142301.587 DEBUG Distance 14 (mm): 1498
1550142301.611 DEBUG Distance 15 (mm): 875
1550142301.637 DEBUG Distance 16 (mm): 875
1550142301.660 DEBUG Distance 17 (mm): 875
1550142301.685 DEBUG Distance 18 (mm): 875
1550142301.708 DEBUG Distance 19 (mm): 1272
1550142301.739 DEBUG Distance 20 (mm): 1272
1550142301.763 DEBUG Distance 21 (mm): 1272
1550142301.787 DEBUG Distance 22 (mm): 430
1550142301.813 DEBUG Distance 23 (mm): 430
1550142301.836 DEBUG Distance 24 (mm): 430
1550142301.860 DEBUG Distance 25 (mm): 430
1550142301.884 DEBUG Distance 26 (mm): 686
1550142301.909 DEBUG Distance 27 (mm): 686
1550142301.934 DEBUG Distance 28 (mm): 686
1550142301.957 DEBUG Distance 29 (mm): 686
1550142301.980 DEBUG No space left in frame
=== Binary Frame: 6 fields in 56 bytes ===
Frame type: 6
Serial ID: 0x623618FDC337DE6E
Waspmote ID: 
Sequence: 1
Sensor 123 (TST): 1550142300
Sensor 52 (BAT): 80
Sensor 63 (ACC): -4
Sensor 63 (ACC): 54
Sensor 63 (ACC): 958
Sensor 210 (BME ext): 6.7600
Sensor 210 (BME ext): 68.5527
Sensor 210 (BME ext): 101214.5800
Sensor 211 (MLX): 5.5899
Sensor 211 (MLX): 7.2500
Sensor 212 (TMP): 6.7500
==========================================
1550142302.126 INFO Frame saved to SD (6 fields in 56 bytes)
1550142308.727 DEBUG readMaxbotixSerial: sample=2201
1550142308.750 DEBUG readMaxbotixSerial: sample=2201
1550142308.774 DEBUG readMaxbotixSerial: sample=2206
1550142308.797 DEBUG readMaxbotixSerial: sample=2205
1550142308.820 DEBUG readMaxbotixSerial: sample=2203
1550142308.844 DEBUG readMaxbotixSerial: sample=2205
1550142308.867 DEBUG readMaxbotixSerial: sample=2202
1550142308.890 DEBUG No space left in frame
=== Binary Frame: 2 fields in 67 bytes ===
Frame type: 6
Serial ID: 0x623618FDC337DE6E
Waspmote ID: 
Sequence: 2
Sensor 123 (TST): 1550142300
Sensor 213 (VL): 497
Sensor 213 (VL): 0
Sensor 213 (VL): 0
Sensor 213 (VL): 0
Sensor 213 (VL): 679
Sensor 213 (VL): 0
Sensor 213 (VL): 0
Sensor 213 (VL): 0
Sensor 213 (VL): 1000
Sensor 213 (VL): 0
Sensor 213 (VL): 0
Sensor 213 (VL): 1498
Sensor 213 (VL): 0
Sensor 213 (VL): 0
Sensor 213 (VL): 0
Sensor 213 (VL): 875
Sensor 213 (VL): 0
Sensor 213 (VL): 0
Sensor 213 (VL): 0
Sensor 213 (VL): 1272
Sensor 213 (VL): 0
Sensor 213 (VL): 0
Sensor 213 (VL): 430
Sensor 213 (VL): 0
Sensor 213 (VL): 0
Sensor 213 (VL): 0
Sensor 213 (VL): 686
Sensor 213 (VL): 0
Sensor 213 (VL): 0
Sensor 213 (VL): 0
==========================================
1550142309.128 INFO Frame saved to SD (2 fields in 67 bytes)
=== Binary Frame: 2 fields in 30 bytes ===
Frame type: 6
Serial ID: 0x623618FDC337DE6E
Waspmote ID: 
Sequence: 3
Sensor 123 (TST): 1550142300
Sensor 214 (MB73XX): 2201
Sensor 214 (MB73XX): 0
Sensor 214 (MB73XX): 5
Sensor 214 (MB73XX): -1
Sensor 214 (MB73XX): -2
Sensor 214 (MB73XX): 2
Sensor 214 (MB73XX): -3
==========================================
1550142309.269 INFO Frame saved to SD (2 fields in 30 bytes)
1550142309.295 INFO Loop done in 9294 ms (CPU time 9294 ms).
1550142309.368 DEBUG Next alarm at 00:11:10:00 in 5 minutes

The SD works just fine when uploading the simplest script using SD (examples)