Skip to main content

FLL EV3 Robot

This blog post is about our current EV3 robot we're planning to use in the 2023/2024 FLL competition. Some features: 2 large motors for steering. 2 medium motors for attachments.  2 colour sensors for picking up the white and black lines, also used for line squaring. 1 gyro sensor. To enable attachments to be changed as quickly as possible we're using gravity to keep the gears connected, i.e. you don't need to fasten anything to the robot. Every attachment has 2x 12 tooth double bevel gear (part 32270) which comes in contact with the 2x 20 tooth double bevel gears (part 32269) on the robot. The medium motors are horizontally aligned on the robots, but we use 12 tooth double bevel gears to convert that to vertical alignments. These in turn are connected to 20 tooth double bevel gears, and the attachments in turn connect to these 20 tooth double bevel gears with their 12 tooth double bevel gears.  The complete robot is modelled in Bricklink Studio 2 . You can download the rob...

TP-Link MR3420 serial connection with Raspberry Pi

It happened to me - I've bricked my TP-Link MR3420 router by changing some settings in /etc/config/firewall, with the result that I couldn't get a connection to the router from either a wired or a wireless connection. And the failsafe option also doesn't work on OpenWRT Backfire 10.03.01, so the only remaining option was the use the router's serial port.

Enters the Raspberry Pi (http://www.raspberrypi.org). The Raspberry Pi has a serial port available on the GPIO pins, and what is nice is that it is operating on the same voltage levels as the TP-Link MR3420's serial port (0V and +3.3V). This means we don't need any RS232 voltage level converters (RS232 goes from -12V to +12V).

The only way to get access to the TP-Link MR3420's serial port is to open the router, and solder some wires to the SJ1 connector (see http://wiki.openwrt.org/toh/tp-link/tl-mr3420#serial). You need to solder at least 3 wires: Tx, Rx and Gnd, which is pins 1-3 on SJ1. You'll also need a 10kOhm resistor between the Tx pin and +3.3V, but I've used the +3.3V pin on the Raspberry Pi's GPIO connector (it means less soldering, but you can also use the +3.3V pin on SJ1 pin 4).

Then all that remains is to connect the Pi's Gnd to MR3420's Gnd, the Pi's Tx to MR3420's Rx, and the Pi's Rx to MR3420 Tx. The pinouts for the Raspberry Pi GPIO connecter can be found here: http://elinux.org/RPi_Low-level_peripherals

In the end the circuit I've used looks as follows:


Real world implementation - note I have no screen/keyboard connected to the Raspberry Pi, was using a session over the network:


On the Raspberry Pi the serial port is normally used for another terminal. We first need to kill this terminal so we can access the port via minicom. The serial port's name is ttyAMA0, so we first find the process ID for this process, then kill it:

pi@raspberrypi:~$ sudo -i
root@raspberrypi:~# ps -ef | grep ttyAMA0
root       818     1  0 19:34 ttyAMA0  00:00:00 /sbin/getty -L ttyAMA0 115200 vt100
root       920   913  0 19:36 pts/0    00:00:00 grep ttyAMA0
root@raspberrypi:~# kill 818
root@raspberrypi:~# minicom -b 115200 -o -D /dev/ttyAMA0

The parameters to minicom:
-b: baud rate of 115200 kbps
-o means no initialisation strings to be sent to the modem
-D /dev/ttyAMA0: device to be used

If you don't have minicom you can install it with "apt-get install minicom".

Then power up the router, and you should get a normal terminal from the router. With this terminal I could reset all settings on the router, transforming it from a brick back to a router. Thank you Raspberry Pi!

Comments

Andrew Leer said…
Question concerning this and another router:

https://raspberrypi.stackexchange.com/questions/85264/debricking-wnr2000v3-with-raspberry-pi-and-a-serial-connection#85269

I'm using minicom to connect to it, any ideas why it acts the way it does in my question?
Andrew Leer said…
I also got a prompt, but it seem to press enter forever:

(Not the same router, but it is still a UART, no?)

https://forum.openwrt.org/t/debricking-wnr2000v3-with-raspberry-pi-and-a-serial-connection/64243
Johan said…
Did you execute the "ps -ef | grep ttyAMA0" command?
root 818 1 0 19:34 ttyAMA0 00:00:00 /sbin/getty -L ttyAMA0 115200 vt100

The line above says it found a process running /sbin/getty which is using ttyAMA0. It's running with PID 818, which means you'll have to kill that process first before you can use minicom. Most likely your PID won't match 818, but use the PID you get back and kill it with the "kill " command.

If you have two processes using the same port it might explain why you're getting weird results back.

Popular posts from this blog

Installing Lego Digital Designer (LDD) on Windows 10

If you're using Windows 10 18.09 or later and try to install Lego Digital Designer (LDD) 4.3.11 you'll probably get an installation error for Adobe Flash Player. However, there is an easy way around it: Download the installation file for LDD 4.3.11. Rename the .exe file to .zip. If you don't see the .exe extension in Explorer, go to "View - Options" on the Explorer menu, then under the "View" tab deselect the "Hide extensions for known file types". Open the zip file with Windows Explorer. Copy all files in the zip to another directory on your computer. In the new folder: Delete install_flash_player_active_x.exe. Copy OpenGLChecker.exe and rename it to install_flash_player_active_x.exe. Run LDDSetup.exe. In short the installer will execute install_flash_player_active_x.exe during the installation process, but all it does now is to execute the same logic as what OpenGLChecker does. In theory you can run any .exe that will not retu...

OpenWRT 3G connection checker & logger

A 3G connection is normally not very stable - so we need something to periodically check it & reconnect when needed. I also wanted a summary email at the end of each day with the total traffic per client. I'm using the following settings/scripts: Edit /etc/crontabs/root (create if not existing): # send stats & disconnect 3G at 23:00 everyday. # check the connection every 5 minutes between 5:00 and 23:00 and reconnect if needed # reboot at 5:00 if /tmp/stats.msg doesn't exist - will be sent in checkconnect */5 5-22 * * * /usr/bin/checkconnection 0 5 * * * if [ ! -s /tmp/stats.msg ]; then reboot ; fi 0 23 * * * /usr/bin/sendstats && ifdown wan The first line will run /usr/bin/checkconnection every 5 minutes between 5:00 and 22:59. Then at 23:00 the  day's statistics will be emailed and the 3G connection disconnected. The next morning at 5:00 it first checks if the email was sucessfully sent at 23:00, if so it will reboot the router (seems to be m...

Windows Hyper-V Server 2019

This post will explain how to use the free Hyper-V Windows 2019 Server version. This version doesn't come with any GUI interface as provided in the full Windows 2019 Server version. Instead it comes with a character interface, but with the help of some third party tools you can easily get a fully functional Hyper-V server for free. The following will be assumed: You have a dedicated server connected to a network and you want to install Hyper-V 2019 on this server to run Virtual Machines and/or act as a file server. You have physical access to this server to do the installation. You have another machine connected to the same network to do remote management, running a recent version of Microsoft Windows. You don't want to join a domain or use Active Directory. You can do this if you want to, but this is not included in this post. First you'll need to download the Hyper-V 2019 ISO from  https://www.microsoft.com/en-us/evalcenter/evaluate-hyper-v-server-2019 . You’ll...