viriato Member Licensed User Longtime User Jan 15, 2018 #1 Hi I am trying to use the second serial port on ESP32, but without success. Can somebody help on this topic ? Thanks
Hi I am trying to use the second serial port on ESP32, but without success. Can somebody help on this topic ? Thanks
Erel B4X founder Staff member Licensed User Longtime User Jan 15, 2018 #2 Have you tried this: https://www.b4x.com/android/forum/threads/additional-hardware-serial-ports.67150/#content ? Upvote 0
Have you tried this: https://www.b4x.com/android/forum/threads/additional-hardware-serial-ports.67150/#content ?
viriato Member Licensed User Longtime User Jan 15, 2018 #3 Hi Erel, Yes I tried it and i got the following error Compiling code. (0.03s) Building project (0.06s) Compiling & deploying Ino project (Node32s - COM3) Error Loading configuration... Initializing packages... Preparing boards... Verifying... C:\Users\fvict\DOCUME~1\B4R\B4RESP32\Objects\bin\sketch\b4r_main.cpp: In function 'void SerialNative1(B4R::Object*)': b4r_main.cpp:9: error: '::Serial1' has not been declared ::Serial1.begin(9600); ^ b4r_main.cpp:10: error: '::Serial1' has not been declared b4r_main::_serialnative1->wrappedStream = &::Serial1; ^ exit status 1 Thanks Upvote 0
Hi Erel, Yes I tried it and i got the following error Compiling code. (0.03s) Building project (0.06s) Compiling & deploying Ino project (Node32s - COM3) Error Loading configuration... Initializing packages... Preparing boards... Verifying... C:\Users\fvict\DOCUME~1\B4R\B4RESP32\Objects\bin\sketch\b4r_main.cpp: In function 'void SerialNative1(B4R::Object*)': b4r_main.cpp:9: error: '::Serial1' has not been declared ::Serial1.begin(9600); ^ b4r_main.cpp:10: error: '::Serial1' has not been declared b4r_main::_serialnative1->wrappedStream = &::Serial1; ^ exit status 1 Thanks
Erel B4X founder Staff member Licensed User Longtime User Jan 15, 2018 #4 Try it with this code: Code: Copy #if C HardwareSerial Serial1(2); void SerialNative1(B4R::Object* unused) { Serial1.begin(9600); //<--You can change the baud rate b4r_main::_serialnative1->wrappedStream = &Serial1; } #end if RX pin is 16, TX is 17 Upvote 0
Try it with this code: Code: Copy #if C HardwareSerial Serial1(2); void SerialNative1(B4R::Object* unused) { Serial1.begin(9600); //<--You can change the baud rate b4r_main::_serialnative1->wrappedStream = &Serial1; } #end if RX pin is 16, TX is 17
viriato Member Licensed User Longtime User Jan 15, 2018 #5 Erel, Excellent , it works Thanks a lot Upvote 0