Skip to content
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

Problem with utility/util.h #24

Open
niggiover9000 opened this issue Dec 6, 2018 · 12 comments
Open

Problem with utility/util.h #24

niggiover9000 opened this issue Dec 6, 2018 · 12 comments

Comments

@niggiover9000
Copy link

Could just be me beeing dumb... To which file should "utility/util.h" in the E131.h link? When compiling if gives me the classical:
"C:\Users\...\Documents\Arduino\libraries\E131-master/E131.h:39:29: fatal error: utility/util.h: No such file or directory
When searching in the explorer, I am not able to find this library. Where should it be and where could I get it, if it was missing on my PC?
Thanks in advance!!!

@jtruax773
Copy link

I was able to resolve this error.. create a utility folder in the e131 library, then create the util.h file with the following in it. From (https://raw.githubusercontent.com/esp8266/Arduino/master/libraries/Ethernet/src/utility/util.h)

#ifndef UTIL_H
#define UTIL_H

#ifndef htons
#define htons(x) ( ((x)<< 8 & 0xFF00) |
((x)>> 8 & 0x00FF) )
#endif

#ifndef ntohs
#define ntohs(x) htons(x)
#endif

#ifndef htonl
#define htonl(x) ( ((x)<<24 & 0xFF000000UL) |
((x)<< 8 & 0x00FF0000UL) |
((x)>> 8 & 0x0000FF00UL) |
((x)>>24 & 0x000000FFUL) )
#endif

#ifndef ntohl
#define ntohl(x) htonl(x)
#endif

#endif

@niggiover9000
Copy link
Author

That's the solution, thanks you so much!!!

@arowe1979
Copy link

how do you create the util.h file? I created the folder Utility insdie the e131 library, however I am not sure how to create a .h file

@niggiover9000
Copy link
Author

how do you create the util.h file? I created the folder Utility insdie the e131 library, however I am not sure how to create a .h file

Right click and create a .txt file. Then change the name to util.h. It will ask you if you really want to change the file name, click yes.

@arowe1979
Copy link

.txt as in a text file? so its just looking for a word or text file with that util.h name and the above text in it?

@niggiover9000
Copy link
Author

Yes, except it is a header file for the programming language C(++)

@arowe1979
Copy link

Ok so in order to make a header file do i need to be in a specific program or when do i need to be to make one if i right click under the utility folder it lets me create a txt file and i renamed it however i still get the same error so i am not doing something right.

@niggiover9000
Copy link
Author

Screenshot 2020-11-29 185346
Does the folder look like this? Did you insert the code @jtruax773 posted above?

@jtruax773
Copy link

Make sure you have don’t have file extensions hidden in windows explorer, otherwise the actual file name will be until.h.txt, see this on how to enable viewing extensions.. https://m.youtube.com/watch?v=PoTah9YBG2Y

@arowe1979
Copy link

I did insert the code or text that was listed above...i am at work now so I will have to look at the file extension when i get home...ty guys for the help

@arowe1979
Copy link

I was able to go in and change the file extension and the above problem is gone but now I cant get the e131 command line to work in the first part of the sketch it ask for my ssid and passcode but the towards the bottom it ha the code listed below I cant get it to compile the sketch it keeps telling me its no declared.

when you look at this part of the sketch what is it asking for ? do I need to replace the words with my actual info?

// only uncomment one of the two below to select
//e131.begin(ssid, passphrase); // unicast
e131.begin(ssid, password, ip, netmask, gateway, dns)

@J-Langberg
Copy link

J-Langberg commented Mar 31, 2021

I've followed the instructions listed above and created the util.h, but I'm now getting new errors

n file included from /Documents/Arduino/libraries/E131-master/E131.h:39:0,
from/Documents/Arduino/sACN_maybe/sACN_maybe.ino:52:
/Documents/Arduino/libraries/E131-master/utility/util.h:6:5: error: expected ')' before '>>' token
((x)>> 8 & 0x00FF) )
^~
In file included from /Documents/Arduino/sACN_maybe/sACN_maybe.ino:52:0:
/Documents/Arduino/libraries/E131-master/E131.h:106:3: error: 'e131_packet_t' does not name a type
} e131_packet_t;
^~~~~~~~~~~~~
/Documents/Arduino/libraries/E131-master/E131.h:141:5: error: 'e131_packet_t' does not name a type; did you mean 'e131_listen_t'?
e131_packet_t pbuff1; /* Packet buffer */
^~~~~~~~~~~~~
e131_listen_t
/Documents/Arduino/libraries/E131-master/E131.h:145:5: error: 'e131_packet_t' does not name a type; did you mean 'e131_listen_t'?
e131_packet_t pwbuff; / Pointer to working packet buffer */
^~~~~~~~~~~~~
e131_listen_t
/Documents/Arduino/libraries/E131-master/E131.h:158:5: error: 'e131_packet_t' does not name a type; did you mean 'e131_listen_t'?
e131_packet_t packet; / Pointer to last valid packet */
^~~~~~~~~~~~~
e131_listen_t
/Documents/Arduino/libraries/E131-master/E131.h: In member function 'uint16_t E131::parsePacket()':
/Documents/Arduino/libraries/E131-master/E131.h:211:27: error: 'pwbuff' was not declared in this scope
udp.readBytes(pwbuff->raw, size);
^~~~~~
In file included from /Documents/Arduino/libraries/E131-master/E131.h:39:0,
from /Documents/Arduino/sACN_maybe/sACN_maybe.ino:52:
/Documents/Arduino/libraries/E131-master/E131.h:219:34: error: 'packet' was not declared in this scope
universe = htons(packet->universe);
^
/Documents/Arduino/libraries/E131-master/utility/util.h:5:22: note: in definition of macro 'htons'
#define htons(x) ( ((x)<< 8 & 0xFF00) |
^
In file included from /Documents/Arduino/sACN_maybe/sACN_maybe.ino:52:0:
/Documents/Arduino/libraries/E131-master/E131.h:219:51: error: expected primary-expression before ';' token
universe = htons(packet->universe);
^
/Documents/Arduino/libraries/E131-master/E131.h:219:51: error: expected ')' before ';' token
/Documents/Arduino/libraries/E131-master/E131.h:221:65: error: expected ')' before ';' token
retval = htons(packet->property_value_count) - 1;
^
/Documents/Arduino/libraries/E131-master/E131.h: In member function 'e131_error_t E131::validate()':
/Documents/Arduino/libraries/E131-master/E131.h:239:22: error: 'pwbuff' was not declared in this scope
if (memcmp_P(pwbuff->acn_id, ACN_ID, sizeof(pwbuff->acn_id)))
^~~~~~
In file included from /Documents/Arduino/libraries/E131-master/E131.h:39:0,
from /Documents/Arduino/sACN_maybe/sACN_maybe.ino:52:
/Documents/Arduino/libraries/E131-master/E131.h:244:19: error: 'pwbuff' was not declared in this scope
if (htonl(pwbuff->root_vector) != VECTOR_ROOT)
^
/Documents/Arduino/libraries/E131-master/utility/util.h:14:22: note: in definition of macro 'htonl'
#define htonl(x) ( ((x)<<24 & 0xFF000000UL) |
^
In file included from /Documents/Arduino/sACN_maybe/sACN_maybe.ino:52:0:
/Documents/Arduino/libraries/E131-master/E131.h:244:40: error: expected primary-expression before '!=' token
if (htonl(pwbuff->root_vector) != VECTOR_ROOT)
^~
/Documents/Arduino/libraries/E131-master/E131.h:246:9: error: expected primary-expression before 'if'
if (htonl(pwbuff->frame_vector) != VECTOR_FRAME)
^~
/Documents/Arduino/libraries/E131-master/E131.h:246:9: error: expected ')' before 'if'
/Documents/Arduino/libraries/E131-master/E131.h:248:13: error: 'pwbuff' was not declared in this scope
if (pwbuff->dmp_vector != VECTOR_DMP)
^~~~~~
/Documents/Arduino/libraries/E131-master/E131.h:250:13: error: 'pwbuff' was not declared in this scope
if (pwbuff->property_values[0] != 0)
^~~~~~
In file included from /Documents/Arduino/sACN_maybe/sACN_maybe.ino:53:0:
/Documents/Arduino/libraries/FastLED/src/FastLED.h: At global scope:
/Documents/Arduino/libraries/FastLED/src/FastLED.h:14:21: note: #pragma message: FastLED version 3.004.000

pragma message "FastLED version 3.004.000"

                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~

exit status 1
Error compiling for board Arduino Mega or Mega 2560.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants