Apple Mac OS
Arduino IDE 2.2.1,
Arduino Uno WiFi rev 2,
Arduino Motor Shield rev3
WiFiNINA.h version 1.8.14
Arduino C++
TCP-IP
void IP_Services(){
Serial.println("entering IP_Services.ino");
// print the SSID of the network you're attached to:
Serial.print("SSID: ");
Serial.println(WiFi.SSID());
// print your board's IP address:
IPAddress ip = WiFi.localIP();
Serial.print("IP Address: ");
Serial.println(ip);
//print the server port being used
Serial.print("server port = ");
Serial.println(serverPort);
// print the received signal strength:
long rssi = WiFi.RSSI();
Serial.print("signal strength (RSSI):");
Serial.print(rssi);
Serial.println(" dBm");
// Get subnet mask
IPAddress subnetMask = WiFi.subnetMask();
Serial.print("Subnet Mask: ");
Serial.println(subnetMask);
// Get MAC address
Serial.print("MAC address: ");
byte mac[6];
WiFi.macAddress(mac);
for (int i = 0; i < 6; i++) {
Serial.print(mac[i], HEX);
if (i < 5) Serial.print(':');
delay(100);
} //for (int i = 0; i < 6; i++)
Serial.println();
Serial.println();
Serial.println("leaving IP_Services");
Serial.println(Serial.available());
while (Serial.available() > 0) {
Serial.print(Serial.read()); // Read and discard a character
} //while (Serial.available() > 0)
} //void IP_Services()
entering IP_Services.ino
SSID: xxxxxx
IP Address: 192.168.1.143
server port = 8081
signal strength (RSSI):-38 dBm
Subnet Mask: 255.255.255.0
MAC address: F8:61:7A:84:21:78
leaving IP_Services
0
���7AY!9)5�-#!��
I keep getting this garbage at the end of this procedure. Adding the delay in MAC Address moved the garbage to the end of the procedure. I tried to clear the serial buffer by using the while loop at the end. The garbage is still there. I assume the garbage has something to do with the program stopping. What am I missing?
void IP_Services(){
Serial.println("entering IP_Services.ino");
// print the SSID of the network you're attached to:
Serial.print("SSID: ");
Serial.println(WiFi.SSID());
// print your board's IP address:
IPAddress ip = WiFi.localIP();
Serial.print("IP Address: ");
Serial.println(ip);
//print the server port being used
Serial.print("server port = ");
Serial.println(serverPort);
// print the received signal strength:
long rssi = WiFi.RSSI();
Serial.print("signal strength (RSSI):");
Serial.print(rssi);
Serial.println(" dBm");
// Get subnet mask
IPAddress subnetMask = WiFi.subnetMask();
Serial.print("Subnet Mask: ");
Serial.println(subnetMask);
// Get MAC address
Serial.print("MAC address: ");
byte mac[6];
WiFi.macAddress(mac);
for (int i = 0; i < 6; i++) {
Serial.print(mac[i], HEX);
if (i < 5) Serial.print(':');
delay(100);
} //for (int i = 0; i < 6; i++)
Serial.println();
Serial.println();
Serial.println("leaving IP_Services");
//Serial.println(Serial.available());
while (Serial.available() > 0) {
Serial.read(); // Read and discard a character
} //while (Serial.available() > 0)
} //void IP_Services()
Arduino sketches require a void setup() function and a void loop() function to compile in the Arduino IDE. Your post is missing both... and as important, the libraries and other information that sets up or passes data to the function in question via global variables.
The plot thickens...
No company is registered as the vendor for mac address prefix F8617A842178.