-
Notifications
You must be signed in to change notification settings - Fork 132
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
Arduino MKR1010 Connection Issue #90
Comments
There are a couple of issues and one potential issue.
Did you change the connector code to use WiFiNINA.h? See the #include in
the connector code and change it.
The connector does not “speak” X Protocol. You must use the older protocol.
So, use port 3306, not 33060.
Set the server IP to the actual IP, not local host or loopback. The
connector won’t work with the loopback address.
…On Wed, Mar 13, 2019 at 10:27 CharlesBarette ***@***.***> wrote:
I have a arduino mkr1010 board with integrated wifi.
It uses WifiNINA instead of WiFi library.
I know the credentials and port are correct because I can connect to the
DB via a java script I wrote.
I can connect to my wifi but it never connects to the DB. Is there an
issue with the fact I am using the mkr1010?
*/
#include <WiFiNINA.h> // Use this for WiFi instead of Ethernet.h
#include <MySQL_Connection.h>
#include <MySQL_Cursor.h>
IPAddress server_addr(127,0,0,1); // IP of the MySQL *server* here
char user[] = "admin"; // MySQL user login username
char password[] = "secret"; // MySQL user login password
// WiFi card example
char ssid[] = "BdeB"; // your SSID
char pass[] = ""; // your SSID Password
WiFiClient client; // Use this for WiFi instead of EthernetClient
MySQL_Connection conn((Client *)&client);
void setup() {
Serial.begin(115200);
while (!Serial); // wait for serial port to connect. Needed for Leonardo
only
// Begin WiFi section
int status = WiFi.begin(ssid, pass);
if ( status != WL_CONNECTED) {
Serial.println("Couldn't get a wifi connection");
while(true);
}
// print out info about the connection:
else {
Serial.println("Connected to network");
IPAddress ip = WiFi.localIP();
Serial.print("My IP address is: ");
Serial.println(ip);
}
// End WiFi section
Serial.println("Connecting...");
if (conn.connect(server_addr, 33060, user, password)) {
delay(1000);
}
else
Serial.println("Connection failed.");
conn.close();
}
void loop() {
}
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#90>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AH0j4PkMR0QorVpEP_kab8XrSSYDaoyYks5vWQrhgaJpZM4btW09>
.
|
I changed from my schools DB to a local database to be able to use port 3306. Where does one find the connector code? |
In your Arduino library folder.
On Wed, Mar 13, 2019 at 12:25 CharlesBarette <notifications@github.com>
wrote:
… There are a couple of issues and one potential issue. Did you change the
connector code to use WiFiNINA.h? See the #include in the connector code
and change it. The connector does not “speak” X Protocol. You must use the
older protocol. So, use port 3306, not 33060. Set the server IP to the
actual IP, not local host or loopback. The connector won’t work with the
loopback address.
… <#m_-288376167505301629_>
On Wed, Mar 13, 2019 at 10:27 CharlesBarette ***@***.***> wrote: I have a
arduino mkr1010 board with integrated wifi. It uses WifiNINA instead of
WiFi library. I know the credentials and port are correct because I can
connect to the DB via a java script I wrote. I can connect to my wifi but
it never connects to the DB. Is there an issue with the fact I am using the
mkr1010? */ #include <WiFiNINA.h> // Use this for WiFi instead of
Ethernet.h #include <MySQL_Connection.h> #include <MySQL_Cursor.h>
IPAddress server_addr(127,0,0,1); // IP of the MySQL *server* here char
user[] = "admin"; // MySQL user login username char password[] = "secret";
// MySQL user login password // WiFi card example char ssid[] = "BdeB"; //
your SSID char pass[] = ""; // your SSID Password WiFiClient client; // Use
this for WiFi instead of EthernetClient MySQL_Connection conn((Client
*)&client); void setup() { Serial.begin(115200); while (!Serial); // wait
for serial port to connect. Needed for Leonardo only // Begin WiFi section
int status = WiFi.begin(ssid, pass); if ( status != WL_CONNECTED) {
Serial.println("Couldn't get a wifi connection"); while(true); } // print
out info about the connection: else { Serial.println("Connected to
network"); IPAddress ip = WiFi.localIP(); Serial.print("My IP address is:
"); Serial.println(ip); } // End WiFi section
Serial.println("Connecting..."); if (conn.connect(server_addr, 33060, user,
password)) { delay(1000); } else Serial.println("Connection failed.");
conn.close(); } void loop() { } — You are receiving this because you are
subscribed to this thread. Reply to this email directly, view it on GitHub <
#90 <#90>>, or
mute the thread
https://github.com/notifications/unsubscribe-auth/AH0j4PkMR0QorVpEP_kab8XrSSYDaoyYks5vWQrhgaJpZM4btW09
.
I changed from my schools DB to a local database to be able to use port
3306.
I also got my computers ip and changed it to that.
Where does one find the connector code?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#90 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AH0j4JjHD5BuxjSqPylVXAxe9181Wca5ks5vWSZkgaJpZM4btW09>
.
|
I have in the library folder, MySQL_connection.h and MySQL_connection.cpp and in none can I find an include with something I would replace with the WiFiNINA |
See MySQL_Packet.h
…On Thu, Mar 14, 2019 at 11:21 CharlesBarette ***@***.***> wrote:
I have in the library folder, MySQL_connection.h and MySQL_connection.cpp
and in none can I find an include with something I would replace with the
WiFiNINA
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#90 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AH0j4BavV3mJymmjSslIXdzu6z_yrg1rks5vWmjrgaJpZM4btW09>
.
|
Closed due to inactivity. Please open a new ticket if this is still relevant. |
I have a arduino mkr1010 board with integrated wifi.
It uses WifiNINA instead of WiFi library.
I know the credentials and port are correct because I can connect to the DB via a java script I wrote.
I can connect to my wifi but it never connects to the DB. Is there an issue with the fact I am using the mkr1010?
*/
#include <WiFiNINA.h> // Use this for WiFi instead of Ethernet.h
#include <MySQL_Connection.h>
#include <MySQL_Cursor.h>
IPAddress server_addr(127,0,0,1); // IP of the MySQL server here
char user[] = "admin"; // MySQL user login username
char password[] = "secret"; // MySQL user login password
// WiFi card example
char ssid[] = "BdeB"; // your SSID
char pass[] = ""; // your SSID Password
WiFiClient client; // Use this for WiFi instead of EthernetClient
MySQL_Connection conn((Client *)&client);
void setup() {
Serial.begin(115200);
while (!Serial); // wait for serial port to connect. Needed for Leonardo only
// Begin WiFi section
int status = WiFi.begin(ssid, pass);
if ( status != WL_CONNECTED) {
Serial.println("Couldn't get a wifi connection");
while(true);
}
// print out info about the connection:
else {
Serial.println("Connected to network");
IPAddress ip = WiFi.localIP();
Serial.print("My IP address is: ");
Serial.println(ip);
}
// End WiFi section
Serial.println("Connecting...");
if (conn.connect(server_addr, 33060, user, password)) {
delay(1000);
}
else
Serial.println("Connection failed.");
conn.close();
}
void loop() {
}
The text was updated successfully, but these errors were encountered: