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 --proxyfloitsch
03/18/2024, 11:45 PMInformatic0re
03/19/2024, 7:57 AMInformatic0re
03/19/2024, 9:54 AMInformatic0re
03/19/2024, 9:55 AMimport esp32.espnow
import esp32.espnow show Address
import log
import gpio
import .utils
logger ::= log.Logger log.DEBUG_LEVEL log.DefaultTarget --name="bouy"
// Station MAC: 3030F9791AE4
ADDRESS ::= Address #[0x30, 0x30, 0xF9, 0x79, 0x1A, 0xE4]
main args:
logger.debug "MACA: $get-mac-address-str"
logger.debug "Start ESP-NOW"
service := espnow.Service.station --key=null
service.add-peer ADDRESS
--channel=11
paket := "test-data".to_byte_array
logger.debug "Send datagram: \"$paket\""
service.send paket --address=ADDRESSInformatic0re
03/19/2024, 9:55 AMimport gpio
import esp32.espnow
import esp32.espnow show Address
import log
import .utils
logger ::= log.Logger log.DEBUG_LEVEL log.DefaultTarget --name="station"
main:
logger.debug "MACA: $get-mac-address-str"
logger.debug "Start Station"
service := espnow.Service.station --key=null
//3030F97919C8
service.add-peer (Address #[0x30, 0x30, 0xF9, 0x79, 0x1A, 0xE4])
--channel=11
while true:
print "Waiting for data"
datagram := service.receive
logger.debug "Received data $datagram.stringify"Informatic0re
03/19/2024, 9:56 AMInformatic0re
03/19/2024, 12:48 PMimport esp32.espnow
import esp32.espnow show Address
import log
import gpio
import .utils
ADDRESS ::= Address #[0x30, 0x30, 0xF9, 0x79, 0x1A, 0xE4]
CHANNEL ::= 0
logger ::= log.Logger log.DEBUG_LEVEL log.DefaultTarget --name="station"
main args:
logger.debug "MACA: $get-mac-address-str"
logger.debug "Start Station"
service := espnow.Service.station --key=null
service.add-peer ADDRESS
--channel=CHANNEL
while true:
print "Waiting for data"
datagram := service.receive
logger.debug "Received data $datagram.stringify"Informatic0re
03/19/2024, 12:48 PMimport esp32.espnow
import esp32.espnow show Address
import log
import gpio
import .utils
ADDRESS ::= Address #[0x30, 0x30, 0xF9, 0x79, 0x1A, 0xE4]
CHANNEL ::= 0
logger ::= log.Logger log.DEBUG_LEVEL log.DefaultTarget --name="bouy"
main args:
logger.debug "MACA: $get-mac-address-str"
logger.debug "Start ESP-NOW"
service := espnow.Service.station --key=null
service.add-peer ADDRESS
--channel=CHANNEL
paket := "test-data".to_byte_array
logger.debug "Send datagram: \"$paket\""
service.send paket --address=ADDRESSInformatic0re
03/19/2024, 12:49 PMInformatic0re
03/19/2024, 12:52 PMInformatic0re
03/19/2024, 12:52 PMfloitsch
03/19/2024, 1:17 PMInformatic0re
03/19/2024, 1:17 PMfloitsch
03/19/2024, 1:18 PMfloitsch
03/19/2024, 1:18 PMfloitsch
03/19/2024, 1:18 PMfloitsch
03/19/2024, 1:19 PMInformatic0re
03/19/2024, 1:19 PMfloitsch
03/19/2024, 1:19 PMfloitsch
03/19/2024, 1:20 PM-D jaguar.disabledInformatic0re
03/19/2024, 1:20 PMjag run ... it will crash and I have to call it a second timefloitsch
03/19/2024, 1:23 PMjag run -D jag.disabled -D jag.timeout=45s my-app.toit. This gives your app 45s to run before Jaguar kills it, so it can accept new requests. If your app stops earlier Jaguar will start up earlier too.
- jag container install -D jag.disabled -D jag.timeout=1000000m my-container my-app.toit. But in this scenario, I would add a small test to the beginning of your code:
main:
pin := gpio.Pin 32 --input --pull-up
if pin.get == 0: return
// Normal code.
This gives you the option of going into Jaguar by just pulling pin 32 (or whichever you want) low (connecting it to ground) when resetting your device.Informatic0re
03/19/2024, 1:25 PMfloitsch
03/19/2024, 1:25 PMInformatic0re
03/19/2024, 1:26 PMfloitsch
03/19/2024, 1:26 PMfloitsch
03/19/2024, 1:26 PMInformatic0re
03/19/2024, 1:27 PMfloitsch
03/19/2024, 1:27 PMInformatic0re
03/19/2024, 1:29 PMfloitsch
03/19/2024, 1:36 PMfloitsch
03/19/2024, 3:36 PMfloitsch
03/20/2024, 12:42 PMkasperl
03/20/2024, 12:54 PMInformatic0re
03/23/2024, 11:16 AM[bouy] DEBUG: MACA: 3030F9791AE4
[bouy] DEBUG: Start ESP-NOW
[bouy] DEBUG: Add peer: 30:30:f9:79:1a:e4 on channel 0
[bouy] DEBUG: Send datagram: "#[0x74, 0x65, 0x73, 0x74, 0x2d, 0x64, 0x61, 0x74, 0x61]"
******************************************************************************
Decoding by `jag`, device has version <2.0.0-alpha.134>
******************************************************************************
EXCEPTION error.
ESP-Now send failed
0: Service.send.<block> <sdk>\esp32\espnow.toit:149:9
1: Mutex.do.<monitor-block> <sdk>\monitor.toit:28:27
2: __Monitor__.locked_.<block> <sdk>\core\monitor_impl_.toit:123:12
3: __Monitor__.locked_ <sdk>\core\monitor_impl_.toit:95:3
4: Mutex.do <sdk>\monitor.toit:28:3
5: Service.send <sdk>\esp32\espnow.toit:143:17
6: main espnow\test-bouy-minimal.toit:26:11
******************************************************************************Informatic0re
03/23/2024, 11:16 AMInformatic0re
03/23/2024, 11:16 AMimport esp32.espnow
import esp32.espnow show Address
import log
import gpio
import .utils
import .rgb-led show RGBLED
ADDRESS ::= Address #[0x30, 0x30, 0xF9, 0x79, 0x1A, 0xE4]
CHANNEL ::= 0
logger ::= log.Logger log.DEBUG_LEVEL log.DefaultTarget --name="bouy"
led := RGBLED
main args:
led.blue
logger.debug "MACA: $get-mac-address-str"
logger.debug "Start ESP-NOW"
service := espnow.Service.station --key=null
logger.debug "Add peer: $ADDRESS on channel $CHANNEL"
service.add-peer ADDRESS
--channel=CHANNEL
paket := "test-data".to_byte_array
logger.debug "Send datagram: \"$paket\""
service.send paket --address=ADDRESSfloitsch
03/23/2024, 11:16 AMInformatic0re
03/23/2024, 11:17 AMimport esp32.espnow
import esp32.espnow show Address
import log
import gpio
import .utils
import .rgb-led show RGBLED
ADDRESS ::= Address #[0x30, 0x30, 0xF9, 0x79, 0x1A, 0xE4]
CHANNEL ::= 0
logger ::= log.Logger log.DEBUG_LEVEL log.DefaultTarget --name="station"
led := RGBLED
main args:
led.green
logger.debug "MACA: $get-mac-address-str"
logger.debug "Start Station"
service := espnow.Service.station --key=null
logger.debug "Add peer: $ADDRESS on channel $CHANNEL"
service.add-peer ADDRESS
--channel=CHANNEL
while true:
print "Waiting for data"
datagram := service.receive
logger.debug "Received data $datagram.stringify"floitsch
03/23/2024, 11:17 AMfloitsch
03/23/2024, 11:18 AMInformatic0re
03/23/2024, 11:19 AMfloitsch
03/23/2024, 11:20 AMfloitsch
03/23/2024, 11:20 AMadd-peer and should give you a deprecation warning if you do use it.Informatic0re
03/23/2024, 11:24 AMInformatic0re
03/23/2024, 11:25 AMfloitsch
03/23/2024, 11:25 AMInformatic0re
03/23/2024, 11:25 AMInformatic0re
03/23/2024, 11:25 AMInformatic0re
03/23/2024, 11:26 AMfloitsch
03/23/2024, 11:26 AM--channel for add-peer anymore since you gave it to the constructor earlierInformatic0re
03/23/2024, 11:27 AMfloitsch
03/23/2024, 11:27 AMInformatic0re
03/23/2024, 11:28 AMfloitsch
03/23/2024, 11:28 AMInformatic0re
03/23/2024, 11:28 AMfloitsch
03/23/2024, 11:29 AMInformatic0re
03/23/2024, 11:29 AMInformatic0re
03/23/2024, 11:29 AMInformatic0re
03/23/2024, 11:31 AMInformatic0re
03/23/2024, 11:31 AMfloitsch
03/23/2024, 11:33 AMInformatic0re
03/23/2024, 11:33 AMfloitsch
03/23/2024, 11:33 AMInformatic0re
03/23/2024, 11:33 AMfloitsch
03/23/2024, 11:33 AMInformatic0re
03/23/2024, 11:34 AM[bouy] DEBUG: Add peer: 30:30:f9:79:1a:e4 on channel 2
[bouy] DEBUG: Send datagram: "#[0x74, 0x65, 0x73, 0x74, 0x2d, 0x64, 0x61, 0x74, 0x61]"
******************************************************************************
Decoding by `jag`, device has version <2.0.0-alpha.143>
******************************************************************************
EXCEPTION error.
ESP-Now send failed
0: Service.send.<block> <sdk>\esp32\espnow.toit:157:9
1: Mutex.do.<monitor-block> <sdk>\monitor.toit:28:27
2: __Monitor__.locked_.<block> <sdk>\core\monitor_impl_.toit:123:12
3: __Monitor__.locked_ <sdk>\core\monitor_impl_.toit:95:3
4: Mutex.do <sdk>\monitor.toit:28:3
5: Service.send <sdk>\esp32\espnow.toit:151:17
6: main espnow\test-bouy-minimal.toit:25:11
******************************************************************************Informatic0re
03/23/2024, 11:34 AMfloitsch
03/23/2024, 11:34 AMfloitsch
03/23/2024, 11:34 AMfloitsch
03/23/2024, 11:35 AMInformatic0re
03/23/2024, 11:35 AMInformatic0re
03/23/2024, 11:36 AMimport esp32.espnow
import esp32.espnow show Address
import log
import gpio
import .utils
import .rgb-led show RGBLED
ADDRESS ::= Address #[0x30, 0x30, 0xF9, 0x79, 0x1A, 0xE4]
CHANNEL ::= 2
logger ::= log.Logger log.DEBUG_LEVEL log.DefaultTarget --name="station"
led := RGBLED
main args:
led.green
logger.debug "MACA: $get-mac-address-str"
logger.debug "Start Station"
service := espnow.Service.station --key=null --channel=CHANNEL
logger.debug "Add peer: $ADDRESS on channel $CHANNEL"
service.add-peer ADDRESS
while true:
print "Waiting for data"
datagram := service.receive
logger.debug "Received data $datagram.stringify"floitsch
03/23/2024, 11:36 AMInformatic0re
03/23/2024, 11:36 AMimport esp32.espnow
import esp32.espnow show Address
import log
import gpio
import .utils
import .rgb-led show RGBLED
ADDRESS ::= Address #[0x30, 0x30, 0xF9, 0x79, 0x1A, 0xE4]
CHANNEL ::= 2
logger ::= log.Logger log.DEBUG_LEVEL log.DefaultTarget --name="bouy"
led := RGBLED
main args:
led.blue
logger.debug "MACA: $get-mac-address-str"
logger.debug "Start Bouy"
service := espnow.Service.station --key=null --channel=CHANNEL
logger.debug "Add peer: $ADDRESS on channel $CHANNEL"
service.add-peer ADDRESS
paket := "test-data".to_byte_array
logger.debug "Send datagram: \"$paket\""
service.send paket --address=ADDRESSfloitsch
03/23/2024, 11:37 AMInformatic0re
03/23/2024, 11:37 AMInformatic0re
03/23/2024, 11:38 AMInformatic0re
03/23/2024, 11:38 AMInformatic0re
03/23/2024, 11:38 AMInformatic0re
03/23/2024, 11:39 AMfloitsch
03/23/2024, 11:39 AMInformatic0re
03/23/2024, 11:40 AMfloitsch
03/23/2024, 11:40 AMInformatic0re
03/23/2024, 11:41 AMInformatic0re
03/23/2024, 11:42 AMInformatic0re
03/23/2024, 11:42 AMfloitsch
03/23/2024, 11:50 AM