Only getting hieroglyphics from Serial Connection (Arduino UNO - Webcam)

Dear board members

I'm new into Arduino and I am running into problems receiving data from serial connection using SoftwareSerial.
This is the output I am getting:

ßßÌÞÑÏÐì@ÝßßÞAá Â?cqp??a1? |l<à`ÌAA=?à°vÀýÿÿÿÿÿ#ÿ!.Ýã²Í ÿ_òì?°.²Â>ýÝüސ]³Rҝ?,þ\?î>ðpþ?æA?Íÿæ ??ý3... and so on...

I tried to convert it or also changed the pins (though rx and tx were wrong)

This is my code:

#include <SoftwareSerial.h>

char c;

SoftwareSerial mySerial(4, 5); // RX, TX

void setup()  
{
 // Open serial communications and wait for port to open:
  Serial.begin(4800); //I tried 4098 and the original setting too...
  
  Serial.println("Goodnight moon!");

  // set the data rate for the SoftwareSerial port
  mySerial.begin(4800);
  mySerial.println("Hello, world?");
}

void loop() // run over and over
{
  if (mySerial.available()) Serial.print(mySerial.read());
  if (Serial.available()) mySerial.write(Serial.read());
}

This is my setting:
Arduino UNO is connected over USB to my computer, I am using SoftwareSerial. PIN 4 is connected to TX, PIN 5 to RX, GND is connected to GND on the board of a webcam (7links robocam PX3309). I did not connect +5V on webcam side to +5V of the arduino, as the +5V is already powering the Webcam.

I did find the RX,TX,GND and VCC lines of the webcam from this website:

I am able to access the webcam (wifi) and send data to the serial connection with the following url:
http://192.168.1.143/comm_write.cgi?port=0&baud=4098&bytes=8&data=hi%20there
The terminal is showing additional signs, but i cannot read anything.

Am I doing something wrong?

Thank you very much for your help. I did search for a solution first, but as far as I know know Arduino should transfer the receiving data to readable format automaticly...

Best regards
Dave

Is this right ?

 Serial.begin(4098);

This was changed after some frustrated testing.. :~

I did set it back to 4800. Could the wrong bandwith cause this hieroglyphes?

cotwild:
This was changed after some frustrated testing.. :~

I did set it back to 4800. Could the wrong bandwith cause this hieroglyphes?

If by "bandwith" you mean baud rate value, then yes that is most likely reason to see garbled data displayed on the serial monitor.

Lefty

:roll_eyes: Yes... Sorry

According the following site it should be 115200
http://www.neknek.net/?p=32

Still no luck. How can I get the right baud rate? I tried a few different..
As the manual does not contain information about the serial connection of the cam, I do not have a clue about the baud rate.

As the top one was the wrong one to play with anyway... did set it back to 4800 and start playing with the mySerial baud rate...

cotwild:
As the top one was the wrong one to play with anyway... did set it back to 4800 and start playing with the mySerial baud rate...

The baud rate is specified in two different places and must be the same. In your sketch the serial.begin() statement tells the sketch what speed to send and receive at. In the serial monitor on the bottom right is a menu to select what baud rate the serial monitor should send and receive at. Make those match or you will never see good serial data.

Lefty

When I did set the Serial baud rate to 4800 and the mySerial to 115200 (as found on a website) I start getting the following output:

2551322271979917710821313065155783717621623521872169452092429216421217552012491732491443845130811684527472291839151261308120843146186132131819045176229652261722257170115314814415326150150150150150

What obviously just seems to be the ASCII values of the hieroglyphes I had before... what's going wrong? When I'm setting both to 4800 or 115200, same wierd behaviour... :drooling_face:

Don't the baud rates just have to match on both sides? but as I am using one serial connection PC-Arduino and one between Arduino and the webcam, the speeds can be different.. right?

What exactly are you expecting to see ?

Sounds like the webcam is setup to be connected to a pc serial port, is that right. If so, you need to invert the polarity of the signals because that's what happens when they go thru a MAX232 to get converted to RS232 voltages. Your baud rate may be correct, but the pins are inverted. Can the softwareserial library accommodate that?

I was trying the whole day to fix that problem and didn't get any step closer. You guys just brought me further :slight_smile:

I try to send commands over Wifi to the webcam, that passes them further to control the arduino.

There was a problem in the link, the baud=*** wasn't the exact baud rate. It is a code that defines the speed. When I do set it to 12 (4800) i do get the following output:

255110111321151171121121111141161010410532116104101114101253110111321151171121121111141161010410532116104101114101245197229

Where ....10410532116104101114101.... is the ASCII code for "hi there" :grin:

So how do I get those converted to a normal string? there is no println(inByte, CHAR) or so..?

After the following bit i'm closer now :slight_smile:

c = char(mySerial.read());
    Serial.print(c);

and get the output:

ÿno support
hi thereõåå

Still don't know what the rest of the hieroglyphes mean... but i should be able to filter out my commands now.

Thanks a lot guys!!!