Cannot receive data from camera

Hi at all! I’m trying to send and receive data from a thermocam. It’s a Flir Tau 2.

This is the wiring:

This is my code:
#include <SoftwareSerial.h>

#define RXPin 12
#define TXPin 13
#define RTSPin 10
#define CTSPin 11

SoftwareSerial mySerial(RXPin, TXPin);

void setup()
{
Serial.begin(57600);
while (!Serial) {
}

mySerial.begin(57600);

Serial.println(“Inizio”);

delay(3000);

pinMode(RTSPin, OUTPUT);
pinMode(CTSPin, INPUT);

byte data[10] = { 0x6E ,0x00 ,0x00 ,0x05 ,0x00 ,0x00 ,0x34 ,0x4B ,0x00 ,0x00 };

Serial.println(“Invio”);

digitalWrite(RTSPin, HIGH);
while (digitalRead(CTSPin) != HIGH)
{}

mySerial.write(data, 10);
mySerial.flush();

digitalWrite(RTSPin, LOW);

Serial.println(“Completato”);
}

void loop()
{
while (mySerial.available())
Serial.println(mySerial.read(), HEX);
}

What am I doing wrong?
Thanks in advance!

What's going wrong? What do you observe?

Do you have the Rx to Tx connected correctly? Are those pins 5V tolerant?
Is the baud rate 57600 for your device?
Is your serial console in the IDE set to 57600 bauds?
Are you properly powering your device?

J-M-L:
What’s going wrong? What do you observe?

Do you have the Rx to Tx connected correctly? Are those pins 5V tolerant?
Is the baud rate 57600 for your device?
Is your serial console in the IDE set to 57600 bauds?
Are you properly powering your device?

Obviously yes. Just don’t think people are stupid.

The problem I’m facing lies elsewhere…

We have no idea whether you are stupid or not, but those are basic troubleshooting steps.

If you were smart, it would be working now, wouldn't it?

Well then describe the pb...

It's not about being smart.
This forum is useless. Nobody reaches the solution

Darn, another failure for telepathy!

Look, we can't see your setup, we might never have use this camera and we have no idea whether you have it wired correctly. What are we supposed to do?

Does anything happen?

Well I see the pb in the picture... there is nothing connected on the RS232 to TTL Serial Adapter on the RS232 side... see we got your bug, you forgot the camera...:slight_smile:

Maybe I just unplugged it to take the picture? :slight_smile:

May be we miss information to help you, don't you think?

There is simple wiring to RTS/CTS and RX/TS, along with VCC and GND of course (or not :slight_smile: ) to a MAX3232 device connected to the thermocam. You also have the sketch. What else do you need?

You send a GET_REVISION (i assume) 0x6E ,0x00 ,0x00 ,0x05 ,0x00 ,0x00 ,0x34 ,0x4B ,0x00 ,0x00 (the 344B CRC-CCITT XModem seems ok) so you should get something back. If you don't that points to a malfunction somewhere else - hence the questions on the wiring or transmission

How is the Flir Tau 2 powered? What's the max amp capability of that power supply? (Needs 600mA at boot if I remember well)

What's the length of the rs232 cable ? What connector do you have on the other side and how is it plugged to the Flir Tau 2?

How have you set the power-on default baud rate? (The receive logic defaults to 57.6k but any chance that was changed?)

have you tried connecting with the hardware Serial and removing your Serial.print to exclude any issue with software serial? (And blink a led or something upon successful connexion)?

The digitalWrite(RTSPin, HIGH); => have you tried setting it to LOW first to ensure a clear transition? ('Should be the case but ...). Have you checked you ever get a high CTS back?

Serial.begin(57600);
    while (!Serial) {
    }
  
    mySerial.begin(57600);

Isn’t trying to run software serial and the built in serial a no no?

-jim lee

J-M-L +1
For Christmas patience with a rude response to a reasonable suggestion.

Hi,
Welcome to the forum.

Please read the first post in any forum entitled how to use this forum.
http://forum.arduino.cc/index.php/topic,148850.0.html

BeYourMaster:
Obviously yes. Just don't think people are stupid.

The problem I'm facing lies elsewhere...

The reason for asking these questions is because we have no idea of what you have done to check out the problem, we have no idea of your; sorry I'll ask it know.

Can you tell us your electronics, programming, arduino, hardware experience?

You may be frustrated at this point with your project but if you go back and read your first post and see no info about the flir or the interface pcb.
But see you have posted 24 posts, yet display your code without code tags, can only lead us to believe you are a novice.

As you have pointed out the request was for basic troubleshooting steps, steps that we were not aware you were capable or aware of doing.

[soapbox]
We start with basic questions and not race off into higher level technical questions, when we can only assume your technical level.
[soapbox/]

Tom... :slight_smile:

Hi,
Are you getting any display on your monitor screen?
Please a link to specs/info of the flir?
Does the gender bender 9pin swap rx/tx?

Thanks.. Tom. :slight_smile:

Ok. Thanks for all.
I checked on RealTerm: even if I disable flow control, it works.

This screenshot is taken from the official PDF of the camera:

No flow control, start and stop bits and LSB (which are SoftwareSerial's defaults).
So, why it does not work? It's driving me crazy!

If I connect my camera with a Prolific RS232 to USB cable, it works, but not with this wiring:

I also tried swapping all of the possible combinations of RX/TX and RTS/CTS!!

Why? Since you have more knowledge in electronics, can you enlight me? xD
Thanks in advance!

When you checked in realTerm, how was the unit connected to your computer? (Inc. Where does the power come from)

Please post a link to your exact camera

Hi! The camera it’s a Flir Tau 2, 19mm, 640x512.

It includes an adapter which outputs an analog video signal and has a mini USB port.

To simplify things, there is also another official adapter, not included in the original package, which I’m using. It has to be attached to the camera, which takes a 5V 1A as power, and outputs the analog video signal and a RS232 port for serial communication.

This device works, as said before, because if I connect the RS232 port to the PC, I can use the official GUI and RealTerm.
Also the video output works on VLC (using a capture usb stick)

The problem is somewhere in the Arduino coding, because it’s like it does nothing…

I need to make this using Arduino.
I know this communication I need is possible, because it has been done before, using Raspberry, but the code is entirely different, because it uses USB, but bytes I try to send are the same.

Do you have any advice?

To simplify things, there is also another official adapter, not included in the original package, which I'm using. It has to be attached to the camera, which takes a 5V 1A as power, and outputs the analog video signal and a RS232 port for serial communication.

Is that what you are using in both cases, with the rs232 to USB cable to the PC and their GUI software and with the rs232 to ttl serial adapter to arduino in the other case?

Is the camera on both cases powered from the 5v 1A supply?