PINE64

Full Version: wifi module
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi, I have recently purchased a Rock64 board and I am quite newbie. 

I want to install an ESP8266 wifi module I have laying in my desk (and I tried before with an Arduino board) but I don't know where to start from.

I'm planning to use use Pi-2 BUS pins 8 and 10 -> GPIO2_A0 (TX) and GPIO2_A1 (RX).

The microchip (and also the rock board) is pretended to be powered by a computer PSU.

I think my ESP is already flashed with updated firmware so the big question is if the rock board will detect my ESP and how would I send AT commands to it.

Thanks in advance.
I wanted to edit the other post but dont know how to do it.

I have noticed that GPIO pins have high voltage by default and also TX/RX pins on the ESP have high voltage. Is there any way to set default voltage (low) on rock's rx/tx pins?

I may have lost some point... any reference or documentation (better for noobs) would be highly appreciated.

Greetings
If you connect a UART device, there is not really any autodetection for that in Linux. You can open the corresponding /dev/ttySx with minicom or some other terminal program for example and see if you get any communication back and forth. This only requires that you know what UART settings for speed, stop bits, parity etc your ESP module needs (e.g. 115200 8N1).

As for setting the GPIO levels, on the low level side you would have to reconfigure them in the devicetree if you need them set during boot up. There is also the default setting the pins have by the hardware (which is input with pull-up enabled if I remember correctly, check the user manual here...). After the pins are configured as UART pins, the UART hardware controls the levels and you can't really influence that behavior....
Hello there Smile

I have connected the ESP module to the Rock board following the same schema, basically it's just TX->RX, RX->TX (Attachment 1)
[Image: Captura.PNG?dl=0]
With those wires connected the board didnt boot so I disconnected pin 10 (board RX, ESP TX), powered on and when boot is finished I reconnected it.

I didn't get minicom connect to the ESP trying different configurations and different ports. 
I also installed setserial and got some output saying no UART port (Attachment 2)
[Image: setserial.PNG?dl=0]
Code:
root@rock64:/home/alberto# setserial -g /dev/ttyS*
/dev/ttyS0, UART: unknown, Port: 0x0000, IRQ: 0
/dev/ttyS1, UART: unknown, Port: 0x0000, IRQ: 0
/dev/ttyS2, UART: unknown, Port: 0x0000, IRQ: 0
/dev/ttyS3, UART: unknown, Port: 0x0000, IRQ: 0
/dev/ttyS4, UART: unknown, Port: 0x0000, IRQ: 0


I tried rewiring TX->TX and RX->RX but i got the same result.

Could you help me, please? I don't have much experience in Linux so I don't know much tools the community uses
As setserial reported that UART ports were unknown I thought I had to configure them so I tried it with setserial (manual and autoconfig) and stty with no results (I received I/O error).

I visited this topic (https://forum.pine64.org/showthread.php?tid=2922) and it says the port I'm trying to use is ttyS2 (I thought it was ttyS0) but I still have the same problem: unrecognized/unconfigured ports or something
Hi, I managed to connect the ESP module to the board through serial port (ttyS2 was disabled). Now I have flashed the module with esp-link firmware that allows the module to act as a wifi bridge. I have been trying to follow this guide but i couldnt follow the second part (software configuration)

When it says "the server" it is referring to a computer connected to the network (home network), right?


What does this code do?

Code:
socat TCP:192.168.1.3:23 PTY,link=/tmp/socat.sock
slattach -L -s 115200 -p slip /tmp/socat.sock
ifconfig sl0 192.168.255.2/24 up
echo 1 > /proc/sys/net/ipv4/ip_forward
iptables -t nat -A POSTROUTING -s 192.168.255.0/24 -o eth0 -j SNAT –to-source 192.168.1.250

What are those IP addresses that have to be configured?

Then on the board's side:
Code:
slattach -L -s 115200 -p slip /dev/ttyUSB0
ifconfig sl0 192.168.255.2/24 up
route add default gw 192.168.255.1

why is that ip the same as the "server"?
that gateway is the router, right?

Im sorry if this is not the proper place to ask this