Welcome, Guest
Username: Password: Remember me

TOPIC: Arduino problem in 5.6

Arduino problem in 5.6 4 years 4 weeks ago #10554

  • marc
  • marc's Avatar
  • OFFLINE
  • Platinum Boarder
  • Posts: 710
  • Thank you received: 70
  • Karma: 24
Hi Bill,

I have had many times issues with the stty settings related to a stable communication in combination with an Arduino.
So, maybe we need to give this a try.
Search the forum on stty.
Will be back......


Take care,

/Marc
Please, use the Wiki if you succeeded your project or solved your problem. Share your work, so we can learn from each other.
Last Edit: 4 years 4 weeks ago by marc. Reason: typo
The administrator has disabled public write access.
The following user(s) said Thank You: brew

Arduino problem in 5.6 4 years 4 weeks ago #10555

  • brew
  • brew's Avatar
  • OFFLINE
  • Expert Boarder
  • Posts: 108
  • Karma: 0
Hello Marc and Claes,

I think the problem is outside of Proview. The message boards of the Arduino community have lots of posts about DallasTemperature. People complain about the DallasTemperature sketch/ library being slow. Like .75 seconds to run a cycle of reading a temp from OneWire devices. My reading of .6 sec to 1.6 seconds for a scan seems to match other people talking on the Arduino forums.

They post various workarounds that use OneWire only, and exclude DallasTemp, so i may try one of those solutions in the arduino Sketches i use.

Or i may just put up with a 1.6 second scan time, since its a brewery, and not too important to the process.

Thanks, guys, for helping me with the proview settings!

I never would have figured out the cause, and the fix (change scan time) in proview, without you two giving me valuable feedback!!

THANKS AGAIN!

bill
The administrator has disabled public write access.

Arduino problem in 5.6 4 years 4 weeks ago #10556

  • marc
  • marc's Avatar
  • OFFLINE
  • Platinum Boarder
  • Posts: 710
  • Thank you received: 70
  • Karma: 24
Hi Brew,

Dallas/Onewire is slow. Can be around 750 ms refresh rate in relation with the driver.
But.... there is more you can try to investigate.
I am still in doubt if the problem is not in the stty settings.

1) Check with lsusb if your settings in /etc/udev/rules.d/99-usb-serial.rules are right

If this is ok:

1) Start the Arduino software and compile/upload your sketch

2) Close the Arduino software and open a terminal (in full screen)

3) stty -F /dev/UNO -g

4) Now you will have a long line with the stty settings related to the Arduino board
It looks like: 10:0:18b1:0:3:1c:7f:15:4:0:0:0:11:13:1a:0:12:f:17:16:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0
Copy this line to rc.local

5) sudo gedit /etc/rc.local
Put this values in a line before "exit 0" as:
stty -F /dev/UNO 10:0:8be:0:3:1c:7f:15:1:0:1:0:11:13:1a:0:12:f:17:16:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0

6) Repeat this for the MEGA (maybe the settings are the same )
like:
stty -F /dev/MEGA 10:0:8be:0:3:1c:7f:15:1:0:1:0:11:13:1a:0:12:f:17:16:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0

Keep the Arduino plugged-in and reboot....
Cross fingers and let me know.....

/Marc
Please, use the Wiki if you succeeded your project or solved your problem. Share your work, so we can learn from each other.
Last Edit: 4 years 4 weeks ago by marc.
The administrator has disabled public write access.

Arduino problem in 5.6 4 years 4 weeks ago #10557

  • brew
  • brew's Avatar
  • OFFLINE
  • Expert Boarder
  • Posts: 108
  • Karma: 0
1) Check with lsusb if your settings in /etc/udev/rules.d/99-usb-serial.rules are right

these are okay ...
SUBSYSTEM=="tty", ATTRS{idVendor}=="2341", ATTRS{idProduct}=="0042", SYMLINK+="MEGA"
SUBSYSTEM=="tty", ATTRS{idVendor}=="2341", ATTRS{idProduct}=="0043", SYMLINK+="UNO"

If this is ok:

1) Start the Arduino software and compile/upload your sketch


done

3) stty -F /dev/UNO -g

okay, i got this readout
10:0:8bb:0:3:1c:7f:15:1:0:0:0:11:13:1a:0:12:f:17:16:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0
for both UNO and MEGA

4)
Copy line to rc.local

5) sudo gedit /etc/rc.local
Put the next line before "exit 0"


(the line of code i used)
stty -F /dev/UNO 10:0:8bb:0:3:1c:7f:15:1:0:0:0:11:13:1a:0:12:f:17:16:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0

okay
i did all that, but something is wrong with my rc.local... or permissions
because when i restart, i get an error
sudo systemctl status rc-local
Mar 28 13:24:40 brewbrain rc.local[865]: stty: /dev/UNO: unable to perform all requested operations

so what i did was
1--restart computer.
2--go into terminal and type

sudo stty -F /dev/UNO 10:0:8bb:0:3:1c:7f:15:1:0:0:0:11:13:1a:0:12:f:17:16:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0
stty -F /dev/MEGA 10:0:8bb:0:3:1c:7f:15:1:0:0:0:11:13:1a:0:12:f:17:16:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0

3--Then load the arduino sketches
4--then start proview

and there was no change --
same .6 second delay on timing.

Does the way i performed the task work correctly ? Or did my shortcut mess it up?
I can go back and figure out what is wrong with rc.local, but since i am not very good, it would take a few hours to make that work.

Thanks again for your time on this!!

bill
The administrator has disabled public write access.

Arduino problem in 5.6 4 years 4 weeks ago #10558

  • marc
  • marc's Avatar
  • OFFLINE
  • Platinum Boarder
  • Posts: 710
  • Thank you received: 70
  • Karma: 24
Hi Bill,

The Arduino sketch you are using is based on the sketch from V5.4 (Proview V2.0.0-1).
In V5.6 is a sketch "Proview V2.0.0-2".
I have no idea if this can be a part of your problem.
By the way it is not necessary to upload every time you reboot the sketch to the Arduino board....

Will be back.

/Marc
Please, use the Wiki if you succeeded your project or solved your problem. Share your work, so we can learn from each other.
The administrator has disabled public write access.

Arduino problem in 5.6 4 years 3 weeks ago #10559

  • brew
  • brew's Avatar
  • OFFLINE
  • Expert Boarder
  • Posts: 108
  • Karma: 0
Hello Marc,

I went through and converted the old sketch to the new sketch.
There was only a few lines changed that i saw.
A BREAK and such. It didn't change the .6 second timing on the proview program.

I did download a sketch that does not use the DallasTemp library, only OneWire.
I have not tested it yet, but maybe it will do something about the timing problem.

Talk to you soon

Thanks!

bill
The administrator has disabled public write access.
Time to create page: 8.769 seconds