Error message unclear with alpha.47
# help
r
I just updated toit from alpha.35 to alpha.47, and now every error message is the same. I got this error message with a modified primitive function, because I entered a wrong argument. Now I'm getting this and I know the problem is related to the UART. I'm decoding with the snapshot used to generate the bin file. Don't know if this is a bug, or my update went wrong. I've reinstalled toit with same outcome. (error message in next message because of discord thread character limit)
Copy code
Decoding by `jag`, device has version <2.0.0-alpha.47>
******************************************************************************
EXCEPTION error. 
OUT_OF_BOUNDS
  0: List_.[]                  <sdk>/core/collections.toit:1780:24
  1: SourceSegment.read_string_ /home/runner/work/toit/toit/tools/snapshot.toit:1335:28
  2: MethodSegment.read_pubsub_entry_ /home/runner/work/toit/toit/tools/snapshot.toit:1398:14
  3: MethodSegment.read_pubsub_info_.<block> /home/runner/work/toit/toit/tools/snapshot.toit:1405:33
  4: Array_.<block>            <sdk>/core/collections.toit:830:31
  5: SmallInteger_.repeat      <sdk>/core/numbers.toit:1194:3
  6: Array_                    <sdk>/core/collections.toit:830:10
  7: List                      <sdk>/core/collections.toit:177:31
  8: MethodSegment.read_pubsub_info_ /home/runner/work/toit/toit/tools/snapshot.toit:1405:12
  9: MethodSegment.read_element_ /home/runner/work/toit/toit/tools/snapshot.toit:1421:20
 10: MapSegment.read_content_.<block> /home/runner/work/toit/toit/tools/snapshot.toit:1370:18
 11: SmallInteger_.repeat      <sdk>/core/numbers.toit:1194:3
 12: MapSegment.read_content_  /home/runner/work/toit/toit/tools/snapshot.toit:1369:12
 13: SourceSegment.content     /home/runner/work/toit/toit/tools/snapshot.toit:1328:33
 14: MapSegment.content        /home/runner/work/toit/toit/tools/snapshot.toit:1374:26
 15: Program                   /home/runner/work/toit/toit/tools/snapshot.toit:87:68
 16: SnapshotBundle.decode     /home/runner/work/toit/toit/tools/snapshot.toit:198:12
 17: handle_system_message     /home/runner/work/toit/toit/tools/system_message.toit:44:22
 18: decode_system_message     /home/runner/work/toit/toit/tools/system_message.toit:89:3
 19: main.<lambda>             /home/runner/work/toit/toit/tools/system_message.toit:75:16
 20: Command.run               <pkg:pkg-cli>/cli.toit:127:33
 21: main                      /home/runner/work/toit/toit/tools/system_message.toit:76:11
----
f
How do you decode the error messages?
r
I'm using erics script
ar p ../output/test.snapshot uuid | hexdump -e '4/1 "%02x" "-" 2/1 "%02x" "-" 2/1 "%02x" "-" 2/1 "%02x" "-" 6/1 "%02x" ".snapshot"'
f
ok. that gives you the correct snapshot (hopefully).
But then you call a tool to get the stacktrace.
Looks like it's
tools/system_message.toit
.
Is that tool up to date?
The
system_message
tool must be aligned with the snapshot.
It's not (always) possible to use a
system_message
tool from one version with the snapshot of another.
r
I updated all my packages and reinstalled toit by cloning a new one on git. How do I update the
system_message
tool
f
It comes with the toit checkout.
Is the snapshot that makes problems compiled with the latest toit, or still from an older Toit version?
r
Its compiled with alpha 47
I'm using the
/toit/build/host/sdk/bin/toit.compile
to make the snapshot
f
can you send me the snapshot?
florian@toit.io
r
Sure, give me a second
f
(and maybe the base-64 message).
r
Sent
f
Copy code
EXCEPTION error. 
DIVISION_BY_ZERO
  0: SmallInteger_./           <sdk>/core/numbers.toit:1120:36
  1: update_states             ../src/status_monitor.toit:106:50
  2: wifi_monitor.<lambda>     ../src/status_monitor.toit:71:9
That's what I get.
Is that realistic?
r
Yes, I guess my jag is broken. I will try and reinstall. Thank you
f
can you do a
jag version
?
r
Copy code
Version:     v1.7.12
SDK version:     v2.0.0-alpha.44
Build date:     2022-12-02T14:21:56Z
f
Try to update your Jaguar.
I just tried it with jag v1.7.14 and there it worked.
r
Okay, thanks
f
Similarly, if you use
system_message.toit
you need to update it.
r
I've never used
system_message.toit
f
ok.
it's the tool that
jag decode
uses.
If you update
jag
it should automatically use a newer version.
r
Now that my jag works, I found a little mistake in the wifi.toit
Copy code
******************************************************************************
Decoding by `jag`, device has version <2.0.0-alpha.47>
******************************************************************************
As check failed: an int (100) is not a string.
  0: string.+                  <sdk>/core/string.toit:399:14
  1: WifiInterface_.signal_strength <sdk>/net/wifi.toit:153:31
  2: update_states             ../src/status_monitor.toit:90:47
  3: wifi_monitor.<lambda>     ../src/status_monitor.toit:71:9
******************************************************************************
The`signal_strength` call has changed since alpha 35, and now it actually asks for the SSID and not RSSI.
Copy code
signal_strength -> float:
    info := (client_ as WifiServiceClient).ap_info handle_
    rssi := info[WIFI_SCAN_SSID_]
    // RSSI is usually in the range [-100..-35].
    rssi = min 65 (max 0 rssi + 100)
    return rssi / 65.0
Changing the
rssi := info[WIFI_SCAN_SSID_]
to
rssi := info[WIFI_SCAN_RSSI_]
works 🙂 the wifi.toit is found under
/lib/net/wifi.toit
f
Thanks!
Do you have a github login, so I can mention you in the commit message?
r
my username is
rikke-rp
f
r
Perfect 👍
3 Views