Soft-uart, uart, won't compile

I have been looking at using uart to communicate with my screen but I keep getting errors with both soft-uart and uart. Both give me “error: use of undeclared identifier ‘SERIAL_PORT_HARDWARE’”, and soft-uart also gives me “fatal error: ‘SoftwareSerial.h’ file not found”.
The latter I assume is some sort of XOD setup problem, as I have Arduino 1.8.10 installed (in /opt/Arduino-1.8.10) and SoftwareSerial is present in the libraries. I can compile a sketch with Arduino ide with “#include <SoftwareSerial.h>” in it and the file is found and the sketch will compile successfully. I’ve checked the XOD folder and found in the __packages__ folder a path to SoftwareSerial, (/home/ian/xod/__packages__/packages/arduino/hardware/avr/1.8.2/libraries/SoftwareSerial) but XOD still can’t find it. I tried adding another directory called 1.8.10 at the same level as 1.8.2, and copied in the same folders from the 1.8.10 install of Arduino, but still get the same error. I think it must have got the 1.8.2 libraries from /home/ian/.arduino15/packages/arduino/hardware/avr/1.8.2, as that library still exists on my computer. I don’t think the latest Arduino ide uses that library any more, but I can’t say for sure. I deleted the .arduino15 folder and it didn’t affect XOD at all. It still worked and still produced the same errors.
The missing identifier I have not been able sort out. I have tried adding it in to the C++ code (with a #define), but it is used in a command and I couldn’t guess what the correct value would be.
I also tried both soft-uart and uart in the web version of XOD and they both returned the same errors.
I also had a look at some other libraries, such as gabbapeople/4d-ulcd and bradzilla84/visi-genie-extra-library, but they also use uart and/or soft-uart nodes, so I could not get them to compile either.

All advice gratefully received.
:-\ Ian

Hi , can you upload a copy of the patch or send it to me privately? I’ll see what else I can help you

What hardware are you trying to compile for? I was having trouble because UNO doesn’t support Serial1 that was hard coded into several libraries I was trying to use.

Thank you for your quick responses.

@cesars I tried two patches, one patch had a “soft-uart” node and nothing else at all, the other also had only one node on it, “uart” and nothing else. For both I clicked the “simulate” button and the error was generated. @gweimer I had previously successfully uploaded a different program (a “blinky”) to my mega2560, so it may have still been set to that. But there was no Arduino plugged into my PC at the time I tried the uart nodes, and I wasn’t trying to upload.

Thanks, Ian

Do not use simulation, many make the mistake of simulating and it is only for simple nodes, if it includes any arduino library it will give error. Use upload abd debug with a board

1 Like

Thank you @cesars, that now compiles!

:slight_smile: Ian

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.