switched to a dedicated AP
This commit is contained in:
parent
357437b36c
commit
9fdd219fb8
3 changed files with 16 additions and 6 deletions
|
@ -11,6 +11,7 @@ use core::panic::PanicInfo;
|
|||
use core::str::from_utf8;
|
||||
|
||||
use bt_hci::cmd::info;
|
||||
use cyw43::JoinOptions;
|
||||
use cyw43_pio::PioSpi;
|
||||
use embassy_rp::pwm::{self, Pwm};
|
||||
use fixed::FixedU16;
|
||||
|
@ -109,12 +110,12 @@ async fn main(spawner: Spawner) {
|
|||
|
||||
control.init(clm).await;
|
||||
control
|
||||
.set_power_management(cyw43::PowerManagementMode::PowerSave)
|
||||
.set_power_management(cyw43::PowerManagementMode::Performance)
|
||||
.await;
|
||||
|
||||
// Use a link-local address for communication without DHCP server
|
||||
let config = Config::ipv4_static(embassy_net::StaticConfigV4 {
|
||||
address: embassy_net::Ipv4Cidr::new(embassy_net::Ipv4Address::new(169, 254, 1, 1), 16),
|
||||
address: embassy_net::Ipv4Cidr::new(embassy_net::Ipv4Address::new(192, 168, 0, 10), 24),
|
||||
dns_servers: heapless::Vec::new(),
|
||||
gateway: None,
|
||||
});
|
||||
|
@ -128,8 +129,17 @@ async fn main(spawner: Spawner) {
|
|||
|
||||
defmt::unwrap!(spawner.spawn(net_task(runner)));
|
||||
|
||||
//control.start_ap_open("door409", 5).await;
|
||||
control.start_ap_wpa2("door409", "babelite", 5).await;
|
||||
loop {
|
||||
match control
|
||||
.await
|
||||
{
|
||||
Ok(_) => break,
|
||||
Err(err) => {
|
||||
info!("join failed with status={}", err.status);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
let mut rx_buffer = [0; 4096];
|
||||
let mut tx_buffer = [0; 4096];
|
||||
|
|
|
@ -111,7 +111,7 @@ async fn main(spawner: Spawner) {
|
|||
|
||||
// Use a link-local address for communication without DHCP server
|
||||
let config = Config::ipv4_static(embassy_net::StaticConfigV4 {
|
||||
address: embassy_net::Ipv4Cidr::new(embassy_net::Ipv4Address::new(169, 254, 2, 1), 16),
|
||||
address: embassy_net::Ipv4Cidr::new(embassy_net::Ipv4Address::new(192, 168, 0, 12), 24),
|
||||
dns_servers: heapless::Vec::new(),
|
||||
gateway: None,
|
||||
});
|
||||
|
|
|
@ -41,7 +41,7 @@ pub async fn wiggle_manager(pwm: PWM_SLICE5, head: PIN_26, tail: PIN_27) -> ! {
|
|||
c.compare_b = 6248;
|
||||
pwm.set_config(&c);
|
||||
|
||||
Timer::after_millis(50).await;
|
||||
Timer::after_millis(500).await;
|
||||
LOCKOUT.store(false, core::sync::atomic::Ordering::SeqCst);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue