Processing ide and Bare bones coffee plotter not outputting on nano

Hello all

arduino uno
bbcc
processing with plotter code
linux mint

I have put together the code from the bare bones coffee pid controller and am trying to tune it however if I use an arduino uno and run the processing ide software and the plotter code, when I run th program with the uno it outputs data no problem. If I use the same code on a nano, it fails to output to the plotter software. When you hit the play/start button in the processing software with the uno the graph appears and you can change the PIDs settings while looking at the graph. If the nano is used when you press the play button a gray box appears the same size as the graph but thats it. I am unsure on what to change as the baud rate is correct in both bits of code.

if i connect the nano to the computer and enter the arduino ide i can connect to the serial monitor no problem so it seems to be communicating with the computer

The plotter code is attached as a doc file

cheers in advance

BBCC plotter code.doc (35.5 KB)

The plotter code is attached as a doc file

That seems like a great file format for code...

Which nano ? There is also 3.3V version which uses less power and runs at 8MHz instead of 16MH. Is that what you have ? how is it connected and powered ?

Post your code as shown in the "how to use this forum-please read" sticky.

Hello groundfungus

I tried using the standard code brackets but it kept exceeding the 9000 caracter limit hence the attached doc file.

J-m-l it’s the 5v 16mhz nano connected and powered by usb.

hence the attached doc file.

Nobody is going to open a .doc file that bloatedly wraps a text file. Get a clue.

As mentioned above when i connect the uno it runs fine when i connect a nano 5v 16mhz via usb the plotter fails to start even with the same program code on each arduino so far i have tried changing the bootloader on the nano to the bootloader used by the uno but i still get the same thing a gray box and the plotter will not start.

the code for the plotter is here

https://playground.arduino.cc/Main/BBCCPlotter

The code on the Uno and nano is

http://playground.arduino.cc/Main/BarebonesPIDForEspresso

If i connect either board to the arduino ide the serial interface woorks fine and i can see what usb has been assigned to the board at that time, but for some reason the plotter software cant find the nano's usb connection even though it is connected and working.
the only thing i have changed is the baud rate to 9600

with the nano is connected the processing ide errors on this line

  myPort = new Serial(this, Serial.list()[0], BAUDRATE);

the daudrate is 9600 changed on both the plotter and the bare bones software

the error message from the ide is

Error opening serialport/dev/ttyS0: incorrect serial port

then gives me a list of dev/tty locations including the one it is actually connected to i can see form the arduino ide with the serial monitor closed that the nano is connected on dev/ttyUSB0

Serial.list()[[color=red]0[/color]] tells Processing to take the first port listed - it seems it’s not your Arduino Nano that’s why it does not work

Ideally print that list and see which entry is the correct one or try out 1,2,3 instead of 0

Hello J-M-L

When the the error happens as can be seen in the attached pic it prints out the entire list of usb locations,
I plugged in the usb and using the arduino ide i could see it was connected to dev/ttyUSB0 from the list it printed i could see that USB0 was number 32

As you mentioned i changed the number in the

from
myPort = new Serial(this, Serial.list()[0], BAUDRATE);
to
myPort = new Serial(this, Serial.list()[32], BAUDRATE);

on changing the number it came straight up outputting the correct data. seems strange that it completely missed USB0 even tho it was in the list but hay ho it now works a treat.

Thank you so much for everyone input much appreciated. :slight_smile:

This is your image
77a1ef8198dfc1ee4f2db4e25e7b0985720ce35d.png

Jonathanw82:
seems strange that it completely missed USB0 even tho it was in the list

I don’t understand why you are surprised. The program does what it is told to do… (The processing program is not being told to try to find an Arduino attached somewhere…)

→ You told the Processing program to use the first entry in the list, so it connects to /dev/ttyS0… if your arduino is not attached there how can you even think this is going to work ?

I was under the impression it found it automatically I see now my error thank you for your help