kax_ori
11/17/2023, 10:16 PMinformatic0re
11/30/2023, 3:03 PMdevice.registers.read-bytes 0x02 1
the device was already found.
Once after a fresh hard-reset of both devices, this works and I receive the byte I was sending from the RP2040. If I try it again it fails with:
EXCEPTION error.
I2C_READ_FAILED
0: Device.read-reg.<block> <sdk>\i2c.toit:235:36
1: Bus.read-reg_ <sdk>\i2c.toit:116:22
2: Device.read-reg <sdk>\i2c.toit:242:17
3: Device.read-reg <sdk>\i2c.toit:235:12
4: Registers.read-bytes <sdk>\i2c.toit:291:20
5: main.<block> master\src\main.toit:26:33
6: HashedInsertionOrderedCollection_.hash-do_ <sdk>\core\collections.toit:2241:3
7: Set.do <sdk>\core\collections.toit:2414:10
8: main master\src\main.toit:22:11
once this error appeared the SDA line is kept LOW (SDA and SCL have pull-up resistors of 10k). Only if I reset both devices it will work again (once).
I am pretty sure this is ma fault in the RP2040 code somehow but I can not firgure out whats the issue and why the SDA is kept low after this issue (which might be a ESP32/toit issue)
Somehow something is missing after this working first time, maybe I forgot to clear a register or something?! I am a bit confused where this is actually coming from. (toit or rp2040) Maybe someone can help me here.nlsrchtr
12/04/2023, 3:43 PM$script_dir/artemis --fleet-root $environment serial flash -p $usbserial_path --group $group --baud 460800
and plugged them into my network. Is there any expected delay for those newly flashed devices to appear under ./bin/artemis --fleet-root production fleet status
?nlsrchtr
12/05/2023, 10:17 AMalex_kaos
12/19/2023, 3:51 PMimport gpio
import gpio.pwm
main:
led := gpio.Pin 10
generator := pwm.Pwm --frequency=50
channel := generator.start led
//channel.set-duty-factor 0.5
sleep --ms=10_000
channel.close
generator.close
led.close
And the monitor outputs:
`[jaguar] INFO: program aecc3774-fdf7-fc6a-1e25-b3c397b6481f started
E (2734368) ledc: freq_hz=1000 duty_resolution=16
******************************************************************************
Decoding by jag
, device has version
******************************************************************************
EXCEPTION error.
UNKNOWN ERROR 0x102(258)
0: pwm-init_ \gpio\pwm.toit:177:3
1: Pwm \gpio\pwm.toit:103:12
2: main led_pwm.toit:6:16
******************************************************************************
[jaguar] ERROR: program aecc3774-fdf7-fc6a-1e25-b3c397b6481f stopped - exit code 1`hhv0001
12/21/2023, 5:26 PMdavidg238
12/29/2023, 7:56 PMmain
initially to look like:
import http
import http.request show RequestIncoming
import http.web_socket
import net
/**
Example that demonstrates a web-socket server.
The server updates a counter for button presses.
*/
network := net.open
addr_str := network.address.stringify
server := http.Server
main:
print "Open a browser on: $network.address:8080"
sessions := {:}
server.listen network 8080:: | request/RequestIncoming response/http.ResponseWriter |
print "enter handler"
websocket := server.web_socket request response
if websocket:
print "ws is: $websocket"
else:
print "request $request.method $request.path $request.body.read"
if request.path == "/":
response.write spa
else:
print "request $request.method $request.path $request.body.read failed"
print "exit handler"
When the page loads, I get:
WebSocket connection to 'ws://192.168.0.174:8080/' failed: Invalid frame header open-ws-connection @ (index):74
which corresponds to the line:
ws = new WebSocket('ws://192.168.0.174:8080');
in the page javascript.
Is this a bug in the new websocket code or cockpit error (as Session.upgrade is replaced)?rejuwi_84285
01/07/2024, 9:42 PMhhv0001
01/11/2024, 7:50 AMjag run -D jag.disabled -D jag.timeout=20000s webserver.toit --assets webserver.assets
but the result is the same.
Can I use an active wifi connection to scan for networks? Or is it physically impossible to scan for networks when a wifi connection has already been established? (I didn't think so, but I might be wrong, - it happens.)hhv0001
01/14/2024, 1:26 PMrikke14
01/16/2024, 11:12 AMpeter__j
01/28/2024, 10:04 AMthomas6886
02/05/2024, 6:07 PMError: Get "http://192.168.2.24:9000/identify": dial tcp 192.168.2.24:9000: connect: connection refused
Over the serial interface I get:
I (525957) example: Socket created
I (525957) example: Socket bound, port 3333
I (525957) example: Waiting for data
E (535967) example: recvfrom failed: errno 11
E (535967) example: Shutting down socket and restarting...
Couldn't find anything in the help or the docs. Does anyone know what is going on? Flashed version 2 alphaz3ugma
02/07/2024, 4:51 AMapef
02/07/2024, 8:26 PMimport serial.ports.uart show Port
, as serial.ports could not be found, to uart show Port
instead. If this was a mistake (and what lead to our problem), then any help to import serial.ports would be appreciated.
When running the example file that is provided with the package (to simply read and output the distance values from the sensor in the terminal), the code seems to stop on this line: msg := "{\"range\": $(dyp.range)}"
which we've narrowed down to the blocking happening on line 40 in the package dyp_a01.toit file --> frame := port.read
. The read function (from the standard library 'uart') is blocking until data is available, according to the documentation.
The sensor is connected to an ESP-WROOM-32, to pins: VIN(5v), RX2 (pin17), TX2 (pin16), GND. The sensor works, it has been verified to be functioning correctly when tested in C with ESP-IDF.informatic0re
02/14/2024, 8:40 AMjag decode WyNVBVVYU1UQdjIuMC4wLWFscGhhLjEzNFNVAFskVSNVEBeZ9UO/CVDXk6Icr6uwT6ZbI1UEVUVTVQlFWENFUFRJT05TVRtVTktOT1dOIEVSUk9SIDB4MzA2OSgxMjM5MylbI1UCVVNbI1URWyNsAAAAA1VGVQBJA3lbI2wAAAADVUZVAUl6tFsjbAAAAANVRlUCSVTPWyNsAAAAA1VGVQNJTvNbI2wAAAADVUZVBElPUVsjbAAAAANVRlUFSVTkWyNsAAAAA1VGVQZJeu9bI2wAAAADVUZVB0kDIFsjbAAAAANVRlUISQJZWyNsAAAAA1VGVQlJCihbI2wAAAADVUZVCkkLgFsjbAAAAANVRlULSQuXWyNsAAAAA1VGVQxJOyVbI2wAAAADVUZVDUk7PVsjbAAAAANVRlUOSTphWyNsAAAAA1VGVQ9JOulbI2wAAAADVUZVEEkKPA==
EXCEPTION error.
UNKNOWN ERROR 0x3069(12393)
0: espnow-send_ <sdk>\esp32\espnow.toit:191:3
1: Service.send.<block> <sdk>\esp32\espnow.toit:145:7
2: Mutex.do.<monitor-block> <sdk>\monitor.toit:28:27
3: __Monitor__.locked_.<block> <sdk>\core\monitor_impl_.toit:123:12
4: __Monitor__.locked_ <sdk>\core\monitor_impl_.toit:95:3
5: Mutex.do <sdk>\monitor.toit:28:3
6: Service.send <sdk>\esp32\espnow.toit:143:17
7: send-task src\toit\espnow\bouy-espnow.toit:33:13
8: main.<lambda> src\toit\espnow\bouy-espnow.toit:19:10
all I changed was setting the address to the service send to be the address of the receiver side.
service.send buffer
--address=Address #[0x8C, 0x4B, 0x14, 0x16, 0x64, 0x60]
I also changed the address on the receiver side to be the one from the sender:
service := espnow.Service.station --key=null
service.add-peer (Address #[0x8C, 0x4B, 0x14, 0x16, 0x6A, 0x6C]) --channel=1
apef
02/22/2024, 9:33 AMkax_ori
02/22/2024, 4:21 PMsedmund.
03/13/2024, 9:44 AMimport dyp_a01 show DYP_A01
import gpio
class sensorModule:
sensorValue := 0
sensor := null
constructor tx_/int rx_/int:
sensor = DYP_A01
// --tx_pin=tx not used
--rx_pin=rx_
start:
task::sensor_read
sensor_read:
print "Sensor reading started."
while true:
sensorValue = sensor.range
sensor.off
get_sensorValue -> int:
return sensorValue
and then we start the reading in the main file:
sensorModule := sensorModule sensor_tx sensor_rx
loraModule.start
sensorModule.start
We would want to have these running independently without blocking one another as they could do with tasks, if the Port.read waits for data. How would we go about implementing services to these classes? For example the one above.kax_ori
03/14/2024, 5:17 PMVersion: v1.29.1
SDK version: v2.0.0-alpha.141
Build date: 2024-02-29T05:23:11Z
sedmund.
03/16/2024, 10:58 PME (13509) rmt(legacy): rmt_set_gpio(519): RMT GPIO ERROR
E (13509) rmt(legacy): rmt_config(673): set gpio for RMT driver failed
******************************************************************************
Decoding by jag, device has version <2.0.0-alpha.141>
******************************************************************************
EXCEPTION error.
UNKNOWN ERROR 0x102(258)
0: rmt-config-tx_ <sdk>/rmt.toit:579:3
1: Channel.configure <sdk>/rmt.toit:421:5
2: Channel <sdk>/rmt.toit:321:12
3: Driver <pkg:toit-dhtxx>/driver_.toit:46:20
4: Dht11 <pkg:toit-dhtxx>/dht11.toit:19:5
5: main temperatureDHT.toit:8:13
******************************************************************************
The error traces back to this line in the driver_.toit:
channel_out_ = rmt.Channel pin
--output
--channel_id=out_channel_id
--idle_level=1
We have tried the DHT11 sensor on an ESP-WROOM-32 and a Heltec Wireless Stick Lite V3 and we get the same error. So we don't think it is the devices or the circuit that causes it.informatic0re
03/18/2024, 11:31 PMservice := espnow.Service.station --key=null
//3030F9791AE4
service.add-peer (Address #[0x30, 0x30, 0xf9, 0x79, 0x1a, 0xe4]) --channel=1
and the client side using:
service := espnow.Service.station --key=null
print "Add peer"
service.add-peer ADDRESS
--channel=1
I also flashed the device using the proxy option:
Flashing: jag flash -p COM19 --chip=esp32s3 --uart-endpoint-rx=44
Monitor: jag monitor -p COM19 --proxy
informatic0re
03/20/2024, 8:02 AMgenerator := pwm.Pwm --frequency=400
I receive this error:
E (218246) ledc: freq_hz=400 duty_resolution=17
******************************************************************************
Decoding by `jag`, device has version <2.0.0-alpha.134>
******************************************************************************
EXCEPTION error.
UNKNOWN ERROR 0x102(258)
0: pwm-init_ <sdk>\gpio\pwm.toit:177:3
1: Pwm <sdk>\gpio\pwm.toit:103:12
2: RGBLED espnow\rgb-led.toit:10:16
3: main test\02-rgb-led.toit:4:10
******************************************************************************
kax_ori
03/23/2024, 1:05 PMError: Unknown option: -o
=> Toit SDK v2.0.0-alpha.143
https://cdn.discordapp.com/attachments/1221082365221146634/1221082365397569596/image.png?ex=66114892&is=65fed392&hm=9f9a535925459cb0c014e5cf83303a88d71ae52544b5824b8c919d06f0200cca&qvist_94698
03/24/2024, 10:39 AMjag run x.toit
, I get:
Error: didn't find any Jaguar devices.
Perhaps you need to be on the same wifi as the device.
You can also specify the IP address of the device
I opened the console.toit.io instead and tried provisioning and claiming the device there instead. It failed to claim the device. This was the same case for all of the devices that I tried with. Tried both with a 2.4 GHz WPA3 network and a personal hotspot from my iPhone. No spaces in the SSID and with Maximise Compatibility enabled.
Next thing I will try, if you dont have any other suggestions, is to create an IoT network with another router.davidg238
03/26/2024, 6:02 AMdavid@MSI-7D43:~/workspaceToit$ git clone https://github.com/toitlang/pkg-cli.git
... etc ...
david@MSI-7D43:~/workspaceToit$ cd pkg-cli
david@MSI-7D43:~/workspaceToit/pkg-cli$ make all
mkdir -p build
# We need to set a build type, otherwise cmake won't run nicely on Windows.
# The build-type is otherwise unused.
cmake -B build -DCMAKE_BUILD_TYPE=Debug
TPKG: toit.pkg
Failing tests:
Skipped tests:
-- Configuring done (0.0s)
-- Generating done (0.0s)
-- Build files have been written to: /home/david/workspaceToit/pkg-cli/build
cmake --build build --target install-pkgs
gmake[1]: Entering directory '/home/david/workspaceToit/pkg-cli/build'
gmake[2]: Entering directory '/home/david/workspaceToit/pkg-cli/build'
gmake[3]: Entering directory '/home/david/workspaceToit/pkg-cli/build'
gmake[4]: Entering directory '/home/david/workspaceToit/pkg-cli/build'
gmake[4]: Leaving directory '/home/david/workspaceToit/pkg-cli/build'
gmake[4]: Entering directory '/home/david/workspaceToit/pkg-cli/build'
/bin/sh: 1: toit.pkg: not found
gmake[4]: *** [tests/CMakeFiles/install-pkgs.dir/build.make:70: tests/CMakeFiles/install-pkgs] Error 127
gmake[4]: Leaving directory '/home/david/workspaceToit/pkg-cli/build'
gmake[3]: *** [CMakeFiles/Makefile2:99: tests/CMakeFiles/install-pkgs.dir/all] Error 2
gmake[3]: Leaving directory '/home/david/workspaceToit/pkg-cli/build'
gmake[2]: *** [CMakeFiles/Makefile2:106: tests/CMakeFiles/install-pkgs.dir/rule] Error 2
gmake[2]: Leaving directory '/home/david/workspaceToit/pkg-cli/build'
gmake[1]: *** [Makefile:134: install-pkgs] Error 2
gmake[1]: Leaving directory '/home/david/workspaceToit/pkg-cli/build'
make: *** [Makefile:12: install-pkgs] Error 2
david@MSI-7D43:~/workspaceToit/pkg-cli$
1) How to resolve the above errors ?
2) If no errors, does this create a named executable, that I can run with the args as defined ?
I don't understand the Usage
comment in examples/main.toit, reading:
Usage:
examples/main.toit <command>
informatic0re
03/26/2024, 10:59 AMamusedgrape
03/28/2024, 5:09 AM<pkg:pkg-http-2.5.0>/connection.toit:332:7: error: Missing implementations for interface methods
class DetachedSocket_ implements tcp.Socket:
^~~~~~~~~~~~~~~
<sdk>/net/tcp.toit:19:3: note: Missing implementation for 'set-no-delay'
set-no-delay enabled/bool -> none
^~~~~~~~~~~~
Compilation failed.
EXCEPTION error.
toit.compile failed with exit code 0
Any ideas on what to do? The code works when not being installed through artemis, so I'm unsure what the issue could be.
Thanks!!amusedgrape
03/28/2024, 3:19 PMamusedgrape
03/28/2024, 9:25 PMHeap report @ out of memory:
┌───────────┬──────────┬─────────────────────────────────────────────────────┐
│ Bytes │ Count │ Type │
├───────────┼──────────┼─────────────────────────────────────────────────────┤
│ 640 │ 1 │ external byte array │
│ 2088 │ 12 │ tls/bignum │
│ 53248 │ 15 │ toit processes │
│ 16384 │ 4 │ system 0 b476094f-1061-696e-a209-3f0ad2a0162d │
│ 24576 │ 6 │ current 1 68a2c931-1e01-4f20-cfbd-6a64b500a955 │
│ 12288 │ 3 │ other 2 836308cc-d8d0-e73d-6648-17a1bcd6d444 │
│ 16384 │ 1 │ heap metadata │
│ 4096 │ 1 │ spare new-space │
│ 6088 │ 21 │ lwip │
│ 9608 │ 837 │ heap overhead │
│ 1944 │ 29 │ event source │
│ 50280 │ 390 │ thread/other │
│ 30984 │ 25 │ thread/spawn │
│ 51368 │ 226 │ untagged │
│ 11936 │ 56 │ wifi │
└───────────┴──────────┴─────────────────────────────────────────────────────┘
Total: 238664 bytes in 775 allocations (93%), largest free 2k, total free 19k