V
V
Vitaly Pukhov2016-09-10 07:53:42
linux
Vitaly Pukhov, 2016-09-10 07:53:42

Why might a program not work under Mono on Rapberry that works fine on Windows?

There is a program that works with the COM port,
Program code
Firmware of the device with which Malinka communicates
It seems like all the rights to the port are there, and I run it as root and there are no errors, but the exchange between them seems to be not going on at all. When I run the program under Windows everything works perfectly. It would seem that the code should be executed in the same way, but here it does not work at all. Does anyone have any ideas where to dig?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexey Sergey, 2016-09-10
@dev_random

you can start by checking the exchange between the RPi and the PC (you need a TTL-USB adapter. In general, it is well described here how to connect to a computer: elinux.org/RPi_Serial_Connection )
on the RPi, for example, like this: socat - file: / dev / ttyACM0,b115200, raw,echo=0
on PC: you can do something like this
if there is no adapter to connect to a PC, you can perform a simple loopback test on the RPi:
put a jumper between the Rx and Tx pins, run the socat command above and try to type characters. we see 2 characters each - everything is OK, the serial port is working. if not -> study the link above.
UPD: RPi seems to display its UART under a different name. On RPi3 -> /dev/ttyAMA0 . previous revisions: /dev/ttyS0

V
Vasily Pechersky, 2016-09-10
@Vasily_Pechersky

Rashbian default configuration has stdout redirection to tty
in /boot/cmdline.txt
dwc_otg.lpm_enable=0 console=ttyAMA0,115200 kgdboc=ttyAMA0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline rootwait
Remove
console= ttyAMA0,115200 kgdboc=ttyAMA0,115200
If this is the third Raspberry, then instead of ttyAMA0 it will be ttyS0.
If the theory is interesting, by default all diagnostic messages are output to the serial console. For debugging, this is at the kernel start level. To work in the serial in applications, this must be disabled.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question