I have updated my pastebin, not big changes yet but I did some cleaning.
I'll change also some of my booleans and replace them with enums.
I did already add them, since I'm also working for a...
Type: Posts; User: unknown_072
I have updated my pastebin, not big changes yet but I did some cleaning.
I'll change also some of my booleans and replace them with enums.
I did already add them, since I'm also working for a...
Thanks laserlight! Will dive into this tomorrow, to enhance my code.
Well, that helped.. With that line you've just sent I've realised something quite logical... Oops.
This line from post #7:
unsigned intresult = 100 * (packetBuffer[0] - '0') + 10 *...
Correct, It won't do anything. It was an attempt to capture the digits in the string, before this I've tried with "%03d"
terraslamp - Pastebin.com
Okay I'll try to explain, it's a bit hard.
The device(lamp) has a unique ID(the 3 digits we are talking about).
This ID can be set through a custom WinForm which I've built for it.
The device...
Ah yes, well that worked! Thanks.
But still, there is a difference in the numbers, and I would say that has to do with the unsigned char vs. char?
For instance, I've set my table ID to 135 (by...
Thanks for the suggestion! first I used 'char' as type for numBytes, since, the packetBuffer is also char. This gave an error.
So then I tried 'int' since, that is wat I originally use as you can...
Hi laserlight, this specific UDP packet is always a 3-digit number.
I'm still experiencing with the max range of that number, but for testing that number is always a value between 100 and 200.
...
Hi christop, yes, correct, in the end it is for Arduino/NodeMCU.
I've tried many things like also;
tableID = packetBuffer; (which gives an compile error since packetBuffer is char and tableID...
Hi all,
I'm about to finalize my project, at last!
Still I'm facing one issue.
I have a UDP multicolor lamp, which works on a unique address (ID) so you can have 100 lamps working...
This actually works now! I do have to clean up a bit but this my result from the serial monitor.
11:12:19.369 -> Received packet of size 13
11:12:19.369 -> From 10.168.1.100, port 9101...
Okay so I've tested this, and yes it works.
09:28:03.457 -> Received packet of size 13
09:28:03.457 -> From 10.168.1.100, port 9101
09:28:03.457 -> Command: 101_available
09:28:03.457 ->...
Hi laserlight,
Thank you!
So I've changed my code:
I've declared expected
snprintf(expected, sizeof(expected), "%u_available", (unsigned int)tableID);
So monday I'll work on this again, first thing, since I really want to finish this piece of code.
It's clear to me that the "+" does not work like this in C. Hopefully I can work this out with...
I checked how to use strcat, but here also, I'm not sure how to read the PacketBuffer, I just want to verify if the 3 digits of the string that is received on the UDP packet are the same as tableID;...
Nope, I still receive errors. Now it can't connect to Serial device.
I've unplugged it and such, but no luck.
Here is my more complete code, maybe it will clear things up.
Once again,...
Hmm okay, sorry first of all, sorry for not completely understanding.
I've tried this, but no results (can't compile it either), must be wrong on my side.
This is what I first of all declare,...
Sorry, I'm not sure how to implement this
I believe I'm trying to fix something quite easy. Still I'm having issues unfortunately.
With my windows forms I'm sending a UDP packet which contains a 3 digits number (for example: `101` )...