Quantcast
Viewing all articles
Browse latest Browse all 4306

General • Re: Static IP on Raspberry Pico

I don't know if this is relevant to micropython - i.e. if there are equivalent functions, but using the SDK I found that this works...

Code:

cyw43_arch_enable_sta_mode();cyw43_arch_lwip_begin();dhcp_stop(cyw43_state.netif);     // turn off DHCPnetif_set_addr( cyw43_state.netif, &IPaddr,&NetMask,&GWaddr); // set the IP addr, gateway & net maskcyw43_arch_lwip_end();
It doesn't require compile. You can prompt for the information from tty, fill these 3 variables before starting network.

Statistics: Posted by ronter — Tue Jan 16, 2024 6:58 pm



Viewing all articles
Browse latest Browse all 4306

Trending Articles