1

I was trying to run this library on Arduino Mega, using ESP8266 as replacement of Wifi Shield, as suggested on my older thread.

The problem is, I got error in compiling, after with this code :

#include <WiFiEsp.h>
#include <WiFiEspClient.h>
#include <WiFiEspUdp.h>


#include "AppleMidi.h"
APPLEMIDI_CREATE_INSTANCE(WiFiUDP, appleMIDI1);
....

exit status 1

'WiFiUDP' was not declared in this scope

if I modified the code into this :

#include <WiFiEsp.h>
#include <WiFiUdp.h>


#include "AppleMidi.h"
APPLEMIDI_CREATE_INSTANCE(WiFiUDP, appleMIDI1);
....

I got this error instead

C:\Program Files (x86)\Arduino\libraries\WiFi\src\utility\server_drv.cpp:313:40: error: 'WARN' was not declared in this scope

WARN("error waitResponse isDataSent");

                                    ^

exit status 1

Full code here at pastebin. I was pretty much stuck now. Please help! :(

Thanks :D

  • WiFiUdp.h is part of the WiFi library for the Arduino WiFi Shield. you can't use it – Juraj Sep 20 '18 at 8:10
2

the WiFiEsp class for UDP is WiFiEspUDP

#include <WiFiEsp.h>
#include <WiFiEspUdp.h>
#include "AppleMidi.h"

APPLEMIDI_CREATE_INSTANCE(WiFiEspUDP, AppleMIDI);
| improve this answer | |
  • So I would just need to change WiFiUDP to WiFiEspUDP and I'm good to go? – Rinaldo Jonathan Sep 20 '18 at 10:57
  • yes, the macro creates an object with template type AppleMidi_Class<WiFiEspUDP> AppleMIDI; – Juraj Sep 20 '18 at 11:01
  • gonna test this tonight. if this works, gonna accept it as answer. thanks for helping me once again :D – Rinaldo Jonathan Sep 20 '18 at 11:19
  • I used #include "WiFiEsp.h" and #include "WiFiEspUdp.h" instead and it compiled. thanks! – Rinaldo Jonathan Sep 21 '18 at 7:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.