Het Elektor forum gaat sluiten. Zie ook deze link. Vanaf vrijdag 1 maart is het niet langer mogelijk om in te loggen op het forum. Wel blijft de inhoud van het forum nog zichtbaar tot het einde van de maand maart. Per 1 april gaat het forum definitief uit de lucht.

Can't make USB serial connection to OSEPP Uno R3

The topic on number crunching

Can't make USB serial connection to OSEPP Uno R3

Postby dshepherd » Sun Aug 05, 2018 9:53 pm

Can't make USB serial connection to OSEPP Uno R3
also posted in Courses / Python Programming and GUI's
ref: https://www.elektor.com/python-3-programming-and-guis

I've ran into a snag at Chapter 5 The Arduino Uno as a Slave
Specifically at Program 5-1 Use check buttons to select state of output
I'm unable to get prog_05_01.py "Write Digital Outputs" to toggle the 4 LEDs I have wired up to

digital output pins 2,3,4,5.
If I execute prog_05_01.py in a terminal , clicking write gives the output:
(repeats 5 times ex tries 0-4)
"Incorrect address or project number for slave, project = 1 address = 1
failed to connect"
I never see tx/rx leds on Uno blinking

I have:
.. loaded slave.hex correctly (no error in log,)
.. set up user pi as a member of dialup group
.. fitted 10uf electrolytic capacitor between reset and ground
.. set slave address = 1, project = 1

My hw/sw setup is:

#1 Raspberry Pi 3b v1.2 ~2015,
OS:Raspbian Linux raspberrypi 4.9.41v7+ #1023 SMP Tue Aug 8 16:00:15 BST 2017 armv1 GNU/Linux
utilities: python3-serial 3.2.1-1, avrdude 6.3.2+rpi1, python 3.5.3 , incl tkinter

#2 OSEPP Uno R3 Plus ~2016, ATmega328P, (note avrdude detects device signature 0x1e950f, probably

m328p )
https://www.osepp.com/electronic-module ... no-r3-plus
dshepherd
 
Posts: 6
Joined: Sun Aug 05, 2018 8:00 pm

Re: Can't make USB serial connection to OSEPP Uno R3

Postby dshepherd » Sun Nov 11, 2018 1:44 pm

Success! (Thanks for your troubleshooting advice Andrew Pratt!)

Root cause:
In my Raspberry Pi 3b environment the Arduino Uno USB connection is seen at /dev/tttyUSB0

To fix Rasp Pi Serial comm problems with prog_05_01.py, prog_05_02.py and others
USE THIS FOR Rasp Pi ...

Note: Don't type in the line numbers, they're for reference only: ex. 85-89

In
/home/pi/programs/chap05_progs
uno_slave.py

change line# 88 to

if fl[3:6] == 'USB':

ex.
class Uno
connect(Self)

85 acms = []
86 file_list = os.listdir('/dev')
87 for fl in file_list:
88 if fl[3:6] == 'USB':
89 acms.append(fl)
dshepherd

Posts: 5
Joined: Sun Aug 05, 2018 3:00 pm
dshepherd
 
Posts: 6
Joined: Sun Aug 05, 2018 8:00 pm


Return to Microcontrollers & Embedded

Who is online

Users browsing this forum: No registered users and 1 guest