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

asked Sep 20, 2018 at 5:22
1
  • WiFiUdp.h is part of the WiFi library for the Arduino WiFi Shield. you can't use it Commented Sep 20, 2018 at 8:10

1 Answer 1

2

the WiFiEsp class for UDP is WiFiEspUDP

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

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.