At first I was connecting a WiFi module to my Arduino uno, but Uno has only one UART and this UART is connected to the USB port. There have been some and very strange problems. After entering the setup mode (M0=1, m1=1), it is indeed possible to set the parameters of the settings are saved successfully, but using C3C3C3 can not get to the version without any return, may be my RX data line without contact issues.
Later I will two UART WiFi module communication, in the computer Sisu connect USB to the serial port (2 USB converter, communication a little problem, use the Linux minicom. minicom Be sure to turn off hardware flow control, 8N1 Protocol 9600 baud rate) no problem at all.
Then I think since there is no problem, I put two modules directly on the Arduino mega2560, mega2560 has 4 UART, two network cards are connected, test transceiver, two modules can send and receive each other, but the data received there is a problem, the middle of a lot of music garbled, Do not know is not the problem of Arduino mega2560 itself.
Reasoning can prove that:
1. Two wireless modules are good, because the USB to the serial port of the minicom to communicate, and no garbled, the transmission of all the correct data
2. Arduino mega2560 can transmit data, but there is garbled, possibly because the mega2560 serial port has the relation.
Since the module is good, I think of another test method, a module using a USB port to the PC, and the other directly to my Raspberry Pi on the UART interface. The result was very sad.
Raspberry Pi Use pyserial write good program can only send, and the module on the PC will not receive any pyserial sent over the data, looked up a lot of information, later found that the UART and Raspberry Pi Bluetooth connected, Blue Yan using the default UART function, so found the following information:
Http://www.cnblogs.com/raffeale/articles/5575162.html the settings of the UART on the Raspberry Pi
You must turn off the Bluetooth UART, and Ras-config must close serial to remove the/DEV/TTYAMA0 related in/boot/cmdline.txt.
Add the following code to the bottom of your/boot/config.txt
DTOVERLAY=PI3-MINIUART-BT (this file can be found in the/boot/overlay directory, if it is not possible to have a pi3-miniuart-bt-overlay, this can also, probably because the raspberry dispatched factory date different module name different , I found someone on the internet to provide Pi3-miniuart-bt-overlay module)
Comment out the other UART settings in/boot/config.txt, this is best commented out, uart_enable=1 also commented out! remember!
sudo apt-get update
sudo apt-get upgrade
sudo reboot
The UART from the start of the Raspberry Pi can be used normally, using minicom Select/dev/ttyama0 interface, 8n1 96,001 cut Normal, PC can receive, PC send Raspberry Pi can also receive. End
Pyserial 3.0.1 has a little problem, just found out.
The serial.is_readable () function is best not to use even if there is data sent past the card master does not move. Use the Serial.in_waiting property to check on OK. Then read directly
E39-TTL-100 General Questions:
1. Can send unable to receive, check M0,M1 pin to set the correct level (m0=1,m1=0 This is full duplex mode)
2. Check whether the Wireless Rx cable is in contact with the normal or replace the RX data cable to try.
3. Check if AUX is 1 and the wireless module will be high when the aux is initialized.
Note: minicom communication or use other serial port programming library must pay attention to some details, 8N1 8 = 8 bytes, n= invalid verification bit, 1 = stop bit, these must be set the same, there are hardware flow control and software flow control all shut down (minicom has this option, If you do not set the hardware flow control is turned on by default)
onxoff=false, rtscts=false, dsrdtr=false These 3 parameters are turned into times that may be encountered, Pyserial default value is False, if you use pyserial you do not need to set these parameters, the default value is ok!
Raspberry Pi 3uart WiFi module commissioning (wasted my 3 days of valuable experience)