Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Relay] Crate Init + Wifi Library #1

Merged
merged 30 commits into from
Feb 4, 2024
Merged

[Relay] Crate Init + Wifi Library #1

merged 30 commits into from
Feb 4, 2024

Conversation

twoshark
Copy link
Collaborator

@twoshark twoshark commented Feb 3, 2024

What

  • A deployable esp32 rust image that connects to a statically configured wifi network

Testing

  • Create a file named cfg.toml in /relay with the following structure:
[relay]
wifi_ssid = "MySSID"
wifi_psk = "S3CR3T"
  • Without an esp32 connected, run the following, they should each succeed without errors:
cd relay
cargo check
cargo clippy
cargo build
  • With an esp32 connected, the following will deploy the program to your board:
cd relay
cargo run

Example successful output (from app_main start):

I (664) main_task: Calling app_main()
I (664) relay: Hello, world!
I (664) relay: Status: Not Connected
[src/main.rs:35] CONFIG.wifi_ssid = "Rattlesnake"
I (684) wifi:wifi driver task: 3ffbf2f0, prio:23, stack:6656, core=0
I (684) wifi:wifi firmware version: 91b9630
I (684) wifi:wifi certification version: v7.0
I (684) wifi:config NVS flash: disabled
I (694) wifi:config nano formating: disabled
I (694) wifi:Init data frame dynamic rx buffer num: 32
I (704) wifi:Init static rx mgmt buffer num: 10
I (704) wifi:Init management short buffer num: 32
I (714) wifi:Init dynamic tx buffer num: 32
I (714) wifi:Init static rx buffer size: 1600
I (714) wifi:Init static rx buffer num: 10
I (724) wifi:Init dynamic rx buffer num: 32
I (724) wifi_init: rx ba win: 6
I (734) wifi_init: tcpip mbox: 32
I (734) wifi_init: udp mbox: 6
I (734) wifi_init: tcp mbox: 6
I (744) wifi_init: tcp tx win: 5744
I (744) wifi_init: tcp rx win: 5744
I (754) wifi_init: tcp mss: 1440
I (754) wifi_init: WiFi IRAM OP enabled
I (754) wifi_init: WiFi RX IRAM OP enabled
I (764) wifi: Starting wifi...
I (774) phy_init: phy_version 4780,16b31a7,Sep 22 2023,20:42:16
E (774) phy_init: esp_phy_load_cal_data_from_nvs: NVS has not been initialized. Call nvs_flash_init before starting WiFi/BT.
W (784) phy_init: failed to load RF calibration data (0x1101), falling back to full calibration
I (864) wifi:mode : sta (78:21:84:8c:7d:2c)
I (864) wifi:enable tsf
I (874) wifi: Scanning...
I (5974) wifi: Found configured access point Rattlesnake on channel 3
I (5974) wifi: Connecting wifi...
I (8394) wifi:new:<3,0>, old:<1,0>, ap:<255,255>, sta:<3,0>, prof:1
I (8594) wifi:state: init -> auth (b0)
I (8604) wifi:state: auth -> assoc (0)
I (8614) wifi:state: assoc -> run (10)
I (8634) wifi:connected with Rattlesnake, aid = 19, channel 3, BW20, bssid = a0:36:bc:a2:86:51
I (8634) wifi:security: WPA2-PSK, phy: bgn, rssi: -49
I (8634) wifi:pm start, type: 1

I (8644) wifi: Waiting for DHCP lease...
I (8654) wifi:<ba-add>idx:0 (ifx:0, a0:36:bc:a2:86:51), tid:0, ssn:0, winSize:64
I (8704) wifi:AP's beacon interval = 102400 us, DTIM period = 1
I (12084) wifi:<ba-add>idx:1 (ifx:0, a0:36:bc:a2:86:51), tid:6, ssn:0, winSize:64
I (12644) esp_netif_handlers: sta ip: 192.168.50.251, mask: 255.255.255.0, gw: 192.168.50.1
I (12644) wifi: Wifi DHCP info: IpInfo { ip: 192.168.50.251, subnet: Subnet { gateway: 192.168.50.1, mask: Mask(24) }, dns: Some(192.168.50.1), secondary_dns: Some(0.0.0.0) }
I (12654) relay: Status: Connection Succeeded.
I (12664) relay: Blue
I (12664) relay: Doing things...
I (13664) relay: Green

@twoshark twoshark changed the title [WIP] Tushar/relay [Relay] Crate Init + Wifi Library Feb 4, 2024
@twoshark twoshark merged commit b01a301 into main Feb 4, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant