Comments (5)
We implement pretty much the Arduino WiFi
library, so for docs the official website is probably the best bet.
That said, ping seems to be working fine here with a very simple MCVE:
#include <WiFi.h>
#ifndef STASSID
#define STASSID "your-ssid"
#define STAPSK "your-password"
#endif
const char* ssid = STASSID;
const char* password = STAPSK;
WiFiMulti multi;
void setup() {
Serial.begin(115200);
Serial.println();
Serial.print("Connecting to ");
Serial.println(ssid);
multi.addAP(ssid, password);
if (multi.run() != WL_CONNECTED) {
Serial.println("Unable to connect to network, rebooting in 10 seconds...");
delay(10000);
rp2040.reboot();
}
Serial.println();
Serial.println("WiFi connected");
Serial.println("IP address: ");
Serial.println(WiFi.localIP());
}
void loop() {
Serial.printf("Ping 8.8.8.8 result: %d\n", WiFi.ping(IPAddress(8,8,8,8)));
Serial.printf("Ping GW result: %d\n", WiFi.ping(WiFi.gatewayIP()));
Serial.printf("Ping 10.0.0.1 result (should fail): %d\n", WiFi.ping(IPAddress(10,0,0,1)));
delay(10000);
}
Gives
11:06:20.291 -> WiFi connected
11:06:20.291 -> IP address:
11:06:20.291 -> 192.168.1.131
11:06:20.325 -> Ping 8.8.8.8 result: 128
11:06:20.325 -> Ping GW result: 128
11:06:35.320 -> Ping 10.0.0.1 result (should fail): -1
from arduino-pico.
WiFi::ping()
already exists. What exactly are you asking about?
from arduino-pico.
Hi,
sorry but I couldn't find any traces in the documentation (arduino-pico.readthedocs.io WiFi) or the examples - so I assumed it not to be implemented.
rgds
from arduino-pico.
as in the docs esp8266 was referenced for WiFi, I primarily looked there and only found reference to ESPpin lib ...
thanks for your clarification !
from arduino-pico.
Yeah, that's kind of on me. The WiFi class itself (i.e. WiFi.begin, WiFi.end, etc.) is pretty much Arduino, but the support classes like WiFiClient, WebServer, etc. are much closer to the ESP8266/32 (if there even is an official Arduino equivalent).
from arduino-pico.
Related Issues (20)
- Unable to silence warnings from the framework/pico-sdk HOT 4
- My code doesn't see rp2040.rebootToBootloader(); HOT 6
- Error in Project configuration on PlatformIO HOT 1
- The function rp2040.fifo.available() does not work as advertised. HOT 6
- W25Q64JV SPI Flash weird behavior
- UnknownPackageError: Could not find the package HOT 2
- Ethernet with interrupt hangs sporadically HOT 21
- Feature Request: dmadison ArduinoXInput support HOT 1
- FYI: Build on Windows HOT 4
- Flashing settings for Listfiles-USB - Docs HOT 4
- Version 3.8.0 Compiler Error HOT 1
- I2S Right Channel is One Sample Shifted in Time from Left HOT 1
- Feature Request: Integration of class MacAddress from arduino-esp32? HOT 2
- Fix enum redeclaration issue when using WiFi and Ethernet HOT 14
- WiFiServer and FreeRTOS - Repeatedly accepting connection eventually causes freeze HOT 4
- Joystick library - please update submodule HOT 1
- LittleFS file not opening on Pico HOT 3
- Question: What limits lwip usage within a FreeRTOS environment to setup/loop and not tasks?
- When using platformio, earlephilhower-based firmware doesn't run after reboot-to-bootloader (but does after hard BOOTSEL+RESET) HOT 4
- Hang with Pico W when using a W5500 and WiFi at the same time.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from arduino-pico.