Serial Gateway connect problem ttyAMA0
Using Mysensors 2.11, latest version of Domoticz (3.58.77), Arduino pro mini 5V directly connected to RPI2 through Tx/Rx connection (having carefully made a voltage divider for 3.3 V Rx on RPI2), have compiled SerialGateway with following parameters :
No connection to Serial Gateway (even after waiting for hours ) :
So I tried to lock the ttyAMA0 in order to see if Domoticz is really tries to connect to ttyAMA0, so have locked ttyAMA0 :
And Domoticz is happy with this (as after a restart of Dmz service) !
No error seen...
I suspect Domoticz doesn't try to connect to ttyAMA0. I already fully disabled the serial boot ability and log on ttyAMA0 in RPI (systemctrl diasble,sudo systemctl stop getty.target, /boot/cmdline.txt does'nt contain any ttyAMA0 reference, disable serial-getty@ttyAMA0.service, ...)
The same hardware is fully functional with my old SD Card (Rasbian/Mysensors installed 1 year ago) !
Is anybody knows what's wrong
how many different USB devices do you have connected to your RPI2?
Mine using RPI3 is connected to dev/ttyUSB0
what happens when you type in a command prompt dmesg | grep tty?
dmesg |grep tty [ 0.000000] Kernel command line: 8250.nr_uarts=0 dma.dmachans=0x7f35 bcm2708_fb.fbwidth=656 bcm2708_fb.fbheight=416 bcm2709.boardrev=0xa02082 bcm2709.serial=0x206ad9b smsc95xx.macaddr=B8:27:EB:06:AD:9B bcm2708_fb.fbswap=1 bcm2709.uart_clock=48000000 vc_mem.mem_base=0x3dc00000 vc_mem.mem_size=0x3f000000 dwc_otg.lpm_enable=0 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait [ 0.001343] console [tty1] enabled [ 1.893707] 3f201000.uart: ttyAMA0 at MMIO 0x3f201000 (irq = 87, base_baud = 0) is a PL011 rev2 [ 21.511692] systemd: Cannot add dependency job for unit getty-static.service, ignoring: Unit getty-static.service failed to load: No such file or directory. [ 21.769044] systemd: Starting system-getty.slice. [ 21.775173] systemd: Created slice system-getty.slice. [ 33.592862] usb 1-1.4: cp210x converter now attached to ttyUSB1 [ 33.603346] usb 1-1.3: ch341-uart converter now attached to ttyUSB0
You find something like this:
ch341-uart converter now attached to ttyUSB0
But I'm not using USB to serial converter, I'm only using native serial GPIO Tx/Rx pins like I said in my 1st post.
By default ttyAMA0 is configured like system console for Linux on Raspberry.
Do you disable it?
console [ttyAMA0] enabled
I think, that this is issue.....
It is used by system.
After folowing your link, dmesg displays :
Now, sems console uses only tty1 but problem persists
This post is deleted!
@lrtsenar But I'm not using USB to serial converter, I'm only using native serial GPIO Tx/Rx pins like I said in my 1st post.
I overlooked this info
Maybe it's a rights problem, can you sudo minicom it? Your domoticz user should be added to the group allowing access to ttys. For me it's group uucp.
I Think, that it is "dialout" group.
Or try start Domoticz: sudo ./domoticz
But I found informations, that handle of "tty"s depends on Rapsbian version too.
"Because OS version jessie has changed to using systemd, the file /etc/initab no longer exists. You must use the systemd command systemctl to stop getty.target that is attached to /dev/ttyAMA0
pi@raspberrypi:~ $ sudo systemctl stop getty.target
NOTE: This will release ttyAMA0 until you reboot/restart the raspberry pi. After you reboot you will have to give the command again."
And for the best - on RPI3 ttyAMA0 is connected to Bluetooth and gpio is ttyS0 and is software emulated.
Did you try to this?
sudo nano /boot/config.txt
Add to the end:
sudo nano /boot/cmdline.txt
Remove everything and add this:
dwc_otg.lpm_enable=0 console=tty1 elevator=deadline net.ifnames=0 root=/dev/mmcblk0p2 rootfsty