Go Down

Topic: Processing doesn't work with APC220 wireless modules. (Read 1 time) previous topic - next topic

blackhand

Hello!

So, i want to connect Arduino with program,written on Processing, by  APC220 wireless modules. I've written a small program for connecting test: when Arduino gets "R", the red led lights up

Code: [Select]

              import processing.serial.*;
           
            Serial myPort;
            OutputStream output;
           
           
            void setup() {
           
              size(320, 240);
           
             
               myPort = new Serial( this, Serial.list()[0], 9600);
          println(Serial.list());
             
             myPort.clear();
           
           
            }
           
           
            void draw() {
              myPort.write("R");
       
            }
       

After connecting Arduino to computer using the USB cord, this program works correctly - it sends on Arduino "R", and led lights up.
Then i tried to do it again, but instead of usb cord i connected Arduino board with PC using APC220 wireless modules. 
    I launched the program,and...it's not working! Nothing is sent to the Arduino. APC220 drivers are installed on the computer properly.
After closing my program and Processing IDE I launched Arduino IDE port monitor. I tried to send "R" to the Arduino, and it worked again!

So,let's generalize  my problem: data transfer to the Arduino, using a program written in Processing, works only when the Arduino  is connected to the computer by USB cord. If  the Arduino connected  with the PC by APC220 wireless modules, it doesn't work with Processing program, but it works with Arduino IDE port monitor (i need only Processing software!).

I think, it's not a hardware problem.

Can anybody help me? Thanks in advance.

P.S sorry for my english :)

PaulS

Processing is writing to the serial port. It has NO way of knowing what is between the port that it is writing to and the device on the other end. The problem is NOT with Processing.

The problem MAY be that the serial port changes when you use the radios. Is the radio on the PC end actually connected to the first port in the list?
The art of getting good answers lies in asking good questions.

blackhand

radio on the PC end  connected to the COM5 - it's reserved for APC220 in the system.  And program queries the port COM5.
Or you mean that  i must reserve COM1 for APC220?

P.S It's suspicious that when I work with the port (when APC 220 is connected to it, of course) using port monitor, the information is sent to the Arduino, and when I work with them through a program written in processing - nothing is sent, isn't  it?

chrisnelnine

I had a similar problem, "data transfer to the Arduino, using a program written in Processing, works only when the Arduino  is connected to the computer by USB cord"

My APC220 kit came with a USB-TTL converter that slots into the USB port at the back of my Mac. The APC220 on the Mac-side fits into the USB-TTL converter.

I did troubleshooting by removing the Mac-side APC220 from the USB-TTL converter and connected both together via male-female breadboarding jumper wires instead: GND-GND, 5V-VCC, RXD-TXD, TXD-RXD.

And... it worked perfectly!

To be clear I can now connect wirelessly between the Mac-side APC220 and the Arduino-side APC220, it's just that the Mac-side APC220 is connected to the Mac via breadboard jumper cables and the USB-TTL converter.


Additional info: I also got success connecting wirelessly using another TTL-USB cable connected to the APC220 on the Mac-side.

Conclusion: If you have this problem examine if the APC220 and the USB-TTL converter combination have an issue with each other. The strange thing is that they only have issues with Processing on my Mac and work fine together if I use the Mac terminal screen command, for example. Beyond me why that is so.

jsbb

Same problem using a PC with Windows 7. Problem solved connecting only the RX, TX, 5V and GND pins of  the APC220 module with the TX, RX, 5V and GND pins of the TTL-USB converter with jumpers.

Thanks you for the troubleshooting post. Helped a lot.

Go Up