BLYNK
HOME       📲 GETTING STARTED       📗 DOCS       ❓HELP CENTER       👉 SKETCH BUILDER

Need help adding usb Dongle to Blynk using a Arduino Mega adk

Well first you need to properly format all the code you pasted here…as per the Welcome Topic instructions, as well as the directions you needed to delete when posting your initial topic… or the code will be removed.

Blynk%20-%20FTFC

Meanwhile, Blynk can connect to the Mega ADK via the primary USB (programming port) and your PC, just like on an UNO, Leonardo, Mega 2650, etc…

http://help.blynk.cc/how-to-connect-different-hardware-with-blynk/arduino/usb-serial

As far as I know, The ADK aspect of it is for connecting to Android devices for other purposes, not for Blynk use. But you can Search :wink: this forum for keywords like Mega ADK if you wish

well that’s lame that this program exist but does not allow to work with usb dongles

Blynk is meant for IoT… generally WiFi and ethernet. The fact that it works over USB serial or BT/BLE is added benefits (and probably more for development then actual use).

Beaside, like BT/BLE a USB OTG link would have limitations without the direct Device <–> Server link… the App is more just the GUI of the system with the Server being the brains and the reason Blynk can be controlled worldwide and with multiple phones and devices on same project… Hardly lame :stuck_out_tongue_winking_eye:

Please repost your code if you so wish, but with proper formatting :slight_smile: Thank you.

well like i said i have a wifi dongle how to set that up

Like I said :wink:

One main difference with the Mega, is that you can use Serial1 at 115200 BAUD instead of SoftSerial at 9600 BAUD.

Here is possibly an easier example to start with for the Mega…

//#define BLYNK_DEBUG   // Advanced diagnostic data... also drastically slows entire sketch
#define BLYNK_PRINT Serial  // This prints to Serial Monitor
#define BLYNK_USE_128_VPINS
#include <ESP8266_Lib.h>  // ESP-01 Link
#include <BlynkSimpleShieldEsp8266.h>  // ESP-01 Link

ESP8266 wifi(&Serial1);  // Pins 18 & 19 on MEGA - For ESP-01 link
BlynkTimer timer;

#define HTB 13  // Set HeartBeat LED pin.

char auth[] = "xxxxxxxxxx";
char ssid[] = "xxxxxxxxxx";
char pass[] = "xxxxxxxxxx";
char server[] = "blynk-cloud.com";
int port = 8080;



void setup() {
  pinMode(HTB, OUTPUT);
  Serial.begin(115200);  // BLYNK_PRINT data - For Serial Monitor
  Serial1.begin(115200);  // Set baud rate - For ESP-01 link
  wifi.setDHCP(1, 1, 1); //Enable dhcp in station mode and save in flash of esp8266
  Blynk.config(wifi, auth, server, port);
  if (Blynk.connectWiFi(ssid, pass)) {
    Blynk.connect();
  }

  // Timed Lambda Function - UpTime counter
  timer.setInterval(1000L, []() {  // Run every second
    Blynk.virtualWrite(V0, millis() / 1000);  // Display the UpTime in Seconds to Widget on V0
  });  // END Lambda Function
}



void loop() {
  timer.run();
  Blynk.run();
}

its saying error compiling for board Arduino mega adk

Arduino: 1.8.9 (Windows 10), Board: "Arduino Mega ADK"

In file included from C:\Users\eugene\Documents\Arduino\sketch_may24c\sketch_may24c.ino:5:0:

C:\Users\eugene\Documents\Arduino\libraries\Blynk/BlynkSimpleShieldEsp8266.h:14:2: error: #error Sorry, we changed things a little bit. Please check new examples for ESP8266. This is easy to fix :)

 #error Sorry, we changed things a little bit. Please check new examples for ESP8266. This is easy to fix :)

  ^

Multiple libraries were found for "BlynkSimpleShieldEsp8266.h"
 Used: C:\Users\eugene\Documents\Arduino\libraries\Blynk
 Not used: C:\Program Files (x86)\Arduino\libraries\Blynk
exit status 1
Error compiling for board Arduino Mega ADK.
Invalid library found in C:\Program Files (x86)\Arduino\libraries\nodemcu-firmware-master: no headers files (.h) found in C:\Program Files (x86)\Arduino\libraries\nodemcu-firmware-master
Invalid library found in C:\Program Files (x86)\Arduino\libraries\nodemcu-firmware-master: no headers files (.h) found in C:\Program Files (x86)\Arduino\libraries\nodemcu-firmware-master

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

Try my example… and if you already did, reload it, as I made some changes just now since my simple reconnection routine wasn’t working the way I wanted it, so I removed it for now.

still didn’t work saying the same

Probably something installed incorrectly or corrupted in your IDE libraries.

#error Sorry, we changed things a little bit. Please check new examples for ESP8266. This is easy to fix

Well, I volunteer hear and am not part of the “we” :stuck_out_tongue_winking_eye: so I have no idea what you are running into, but none of that will be relevant to the example I provided… unless your libraries are incorrectly installed or corrupted.

1 Like

• Hardware model Arduino Mega ADK has a onboard USB Host Shield
how do i get the USB Host Shield to work with USB Wifi Dongle and Communicate with blynk?

Creating another topic will not change the initial topics basic answer (you probably can’t… at least the way you seem to be trying) :stuck_out_tongue: I merged the two topics, please don’t do that again.

ok…

Basically, in regards to using a WiFi USB dongle, your issue is not one with Blynk… rather with whatever methods Arduino supplies.

Once you can get a WiFi communication channel going to the internet/network (if possible), you can use Blynk’s Blynk.config() command to try an initiate a server link over that channel…

But aside from the intellectual challenge of that… it is probably much easier to use a simple and proven ESP-01 as a WiFi transceiver and connect it to Serial1 like I do.


thats the library im using for the usb to wifi or bluetooth dongle

Sorry, but this is not really something we can help with here… this is the Blynk forum, so once you figure out what you need (Arduino forum perhaps?), then we can assist with your learning/using Blynk over that link.

Or like most other regular users here will probably say… get an ESP8266 or ESP32 Dev board for a few bucks and start using Blynk right away :wink:

it would be better to buy a nodemcu for only $ 3, or an esp32 for $ 5
@GunnerTechTools :joy::joy:

2 Likes

how would it be better if i already have a usb dongle, lol if u want to buy me one go ahead i can put my mailing address

2 Likes