Garbage out of Serial Monitor using UART or I2C w/ Arduino UNO R3

userHead mtravizano 2020-08-24 02:11:23 4536 Views5 Replies
Hi guys, i just got the HUSKYlens with firmware 4.7. When I try to run the HUSKYLENS_GET_STARTED code i get:

.../Arduino/libraries/HUSKYLENS/HuskyLensProtocolCore.c: In function 'husky_lens_protocol_write_begin': .../Arduino/libraries/HUSKYLENS/HuskyLensProtocolCore.c:135:12: warning: return from incompatible pointer type [-Wincompatible-pointer-types] return &send_buffer; ^~~~~~~~~~~~

When I upload the code to the Arduino UNO R3 (the one DFRobot sells) I can only get GARBAGE on the serial monitor.

Example: ⸮⸮⸮5⸮q>Q⸮⸮⸮⸮⸮⸮⸮F⸮&⸮[-⸮末⸮⸮⸮⸮⸮⸮⸮v⸮2⸮⸮⸮P⸮h1⸮⸮⸮⸮⸮⸮r1⸮2⸮Ҧ⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮r1⸮⸮⸮:`⸮>⸮⸮⸮⸮⸮⸮⸮⸮5⸮RI⸮⸮4⸮ˎ⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮

Same happens for both UART and I2C. I tried changing the Arduino and cables, but the same problems remain. Not sure if the first problem is related to the last one. Ideas? Thanks in advance.
2020-10-27 20:53:45 I just posted this on another thread. I changed the "Serial.begin(115200)" to "Serial.begin(9600)" and it worked fine after. userHeadPic nonnie1026
2020-08-24 20:47:39 That's a great point. We could try verifying the Serial connectivity outside of the example sketch. That way we can confirm the hardware is working properly with communication. Even with a failure of the huskylens.begin function, we should still see normal strings

Maybe just have a barebones sketch with Serial communications and gradually start adding content until you start to see problems
userHeadPic dicidan969
2020-08-24 18:29:15 Do you modify the code?
Please do not modify the code, directly upload it to your arduino board. Then remove the huskylens from your arduino board. Then reset it. Open the serial monitor, you will see the texts below:
Begin failed!
1.Please recheck the "Protocol Type" in HUSKYLENS (General Settings>>Protocol Type>>Serial 9600)
2.Please recheck the connection.
If you also get the GARBAGE in the serial monitor.Please use another example: File -> Examples ->04.Communication -> ASCIITable.
Do not modify the example, and directly upload it to your arduino board. Then open the serial monitor to see if you can get the correct texts(maybe you need to reset your arduino board). If still not, there will be something wrong on your hardware.
userHeadPic Youyou
2020-08-24 05:02:34 Yep... all double-checked... it's not the bauds nor the pins. Any other suggestion?? userHeadPic mtravizano
2020-08-24 03:58:43 The latter sounds like a Baud rate mismatch on the serial port(s). Is the device set to "AutoDetect" and you're using the default entries in the example code, with the serial monitor Baud set to 115200?
Code: Select all
  Example HuskyLens_Get_Started
SoftwareSerial mySerial(10, 11);     // RX, TX  pins to wire signal wires to the arduino
    Serial.begin(115200);       // This is the Serial Monitor port for your PC connection and such
    mySerial.begin(9600);     // This is specific for the Huskylens to talk directly to the Arduino
    while (!huskylens.begin(mySerial)) {
I'm not sure on the first issue or if it's related or not. It could be related if both ports are talking across the same lines or something weird, not sure. Are you also using pins 10 & 11 as the example code? Maybe someone else may have some insight
userHeadPic dicidan969