1
votes

On one side I have a device with a USB (FTDI chip) interface communicating in serial 9600bps,N,8,1 - the default configuration for the Arduino USB/serial interface. On the other side I have a simple Arduino sketch that starts a serial session and transmits data.

void setup() {
  // put your setup code here, to run once:
  Serial.begin(9600,SERIAL_8N1);
}

void loop() {
  // put your main code here, to run repeatedly: 
  char* data_to_send="66"; 
  SSEND(data_to_send);
  delay(5000);
}

String SSEND(char* data){
  String protocol="AT$SF=";
  protocol+=(String)data;
//  protocol+="\r";
  Serial.println(String(protocol));
  delay(1000);
  return "OK";
}

The sketch works just fine when connected to the computer. Then I try to connect to the device and I see the Tx LED that stops blinking so it doesn't send anything and of course the device doesn't work like expected. Besides, I tried sending serial commands directly from the computer to the device and it works just fine.

So my questions are:

  • Why does the serial interface between Arduino and my device doesn't work?
  • Why does Arduino stop sending data once the USB/serial interface switched from the computer to the device
  • What would be the solution to make the device work with the Arduino?
  • Should I switch the TX & RX with a splitted FTDI cable plugged to port 0 and 1?

Thanks for your help

Picture of the connection

1
A schemtic would be helpful. I suspect a problem with power or GND.Turbo J
I suspect the problem is electric, as Turbo said. As the serial interface is full-duplex, there is not reason to split the communication.jcoppens
Thanks for your interest - so basically the schematic is : <arduino><usb port>----<usb cable>----<usb port of device> I added a picture in the post.fro
Did you ever get this to work?Jasper
no - do you have any idea?fro

1 Answers

2
votes

I suspect that device is a USB device and not a USB host, and you plugged two USB devices together. That Arduino is not a USB host, and a USB connection always needs a host.

The plug adapter you're using is not even supposed to exist according to the USB spec, because the different shapes of plugs are specifically there to make it impossible to plug two devices into each other like you've done here.

The way to make it work would be to use another board that actually supports acting as a USB host.