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

Installing OpenWRT 10.03.1 on a TP-Link MR3420

Update: click here for installation instructions of OpenWRT 14.09 on TP-Link MR3420.

The idea is to install OpenWRT 10.03.1 on a TP-Link MR3420 and configure it to use a 3G USB modem. I'll assume you have a Windows computer where you can connect with 3G USB modem.

First flash the router with the OpenWRT image. See  http://wiki.openwrt.org/toh/tp-link/tl-mr3420 for more details. Reboot the router.

Then set your computer ethernet connection to a fixed IP address of 192.168.1.100 with subnet of 255.255.255.0. Connect the router port 1 to the computer. From the computer you should be able to ping 192.168.1.1. Then telnet to 192.168.1.1. You'll get a busybox shell, type passwd and provide a new root password. Once this is set telnet will be disabled and you'll only have access via SSH. 

Open a web browser to 192.168.1.1. Log in with username root and password as defined above. Then go set up your wireless settings & configure everything there. Reboot the router and unplug the network cable. Make sure you get a wireless connection between your computer and the router - you'll need it later on.

On you computer set you lan connection IP settings back to automatic. Then share your 3G connection to your ethernet connection (go to your adapter settings, choose Advanced and select share). Connect you computer network to the WAN port on the router. The reason is we need to access the internet from the router. SSH into your router (192.168.1.1) and make sure you can ping an internet address.

Then install the following packages
opkg update
opkg install chat comgt kmod-usb-acm kmod-usb-serial kmod-usb-serial-option kmod-usb-uhci libusb luci-proto-3g mini-sendmail usb-modeswitch usb-modeswitch-data
Reboot the router and unplug the WAN connection. Also disable internet sharing on your computer.

SSH back into the router once it is rebooted. Unplug the USB 3G device from the computer and plug it into the router. Type dmesg, you should see something like

usb 1-1: new high speed USB device using ar71xx-ehci and address 2
usb 1-1: configuration #1 chosen from 1 choice
usb 1-1: usbfs: process 2978 (usb_modeswitch) did not claim interface 0 before use
usb 1-1: USB disconnect, address 2
usb 1-1: new high speed USB device using ar71xx-ehci and address 3
usb 1-1: configuration #1 chosen from 1 choice
option 1-1:1.0: GSM modem (1-port) converter detected
usb 1-1: GSM modem (1-port) converter now attached to ttyUSB0
option 1-1:1.3: GSM modem (1-port) converter detected
usb 1-1: GSM modem (1-port) converter now attached to ttyUSB1
option 1-1:1.4: GSM modem (1-port) converter detected
usb 1-1: GSM modem (1-port) converter now attached to ttyUSB2

Using your browser, go to router web interface on 192.168.1.1. Go to Network - Interfaces and click on wan. Change the interface to UMTS/GPRS/EV-DO and confirm the switch. Choose device /dev/ttyUSB0, service type=UMTS/GPRS, APN=internet (or whatever APN your 3G is using) and click on Save & Apply.

Then via SSH you need to add the following line to /etc/config/network section for interface wan:
option 'pppd_options' 'noipdefault'

Then via SSH type "ifup wan". wait for a couple of seconds, then type "logread".

If you need more debugging, change /etc/ppp/options and insert "debug" in the file.

My logread on a successful connection looks as follows:
Jul 21 11:53:31 OpenWrt daemon.notice pppd[10455]: pppd 2.4.4 started by root, uid 0
Jul 21 11:53:32 OpenWrt local2.info chat[10460]: abort on (BUSY)
Jul 21 11:53:32 OpenWrt local2.info chat[10460]: abort on (NO CARRIER)
Jul 21 11:53:32 OpenWrt local2.info chat[10460]: abort on (ERROR)
Jul 21 11:53:32 OpenWrt local2.info chat[10460]: report (CONNECT)
Jul 21 11:53:32 OpenWrt local2.info chat[10460]: timeout set to 10 seconds
Jul 21 11:53:32 OpenWrt local2.info chat[10460]: send (AT&F^M)
Jul 21 11:53:32 OpenWrt local2.info chat[10460]: expect (OK)
Jul 21 11:53:32 OpenWrt local2.info chat[10460]: AT&F^M^M
Jul 21 11:53:32 OpenWrt local2.info chat[10460]: OK
Jul 21 11:53:32 OpenWrt local2.info chat[10460]:  -- got it
Jul 21 11:53:32 OpenWrt local2.info chat[10460]: send (ATE1^M)
Jul 21 11:53:32 OpenWrt local2.info chat[10460]: expect (OK)
Jul 21 11:53:32 OpenWrt local2.info chat[10460]: ^M
Jul 21 11:53:32 OpenWrt local2.info chat[10460]: ATE1^M^M
Jul 21 11:53:32 OpenWrt local2.info chat[10460]: OK
Jul 21 11:53:32 OpenWrt local2.info chat[10460]:  -- got it
Jul 21 11:53:32 OpenWrt local2.info chat[10460]: send (AT+CGDCONT=1,"IP","internet"^M)
Jul 21 11:53:32 OpenWrt local2.info chat[10460]: timeout set to 30 seconds
Jul 21 11:53:32 OpenWrt local2.info chat[10460]: expect (OK)
Jul 21 11:53:32 OpenWrt local2.info chat[10460]: ^M
Jul 21 11:53:33 OpenWrt local2.info chat[10460]: AT+CGDCONT=1,"IP","internet"^M^M
Jul 21 11:53:33 OpenWrt local2.info chat[10460]: OK
Jul 21 11:53:33 OpenWrt local2.info chat[10460]:  -- got it
Jul 21 11:53:33 OpenWrt local2.info chat[10460]: send (ATD*99***1#^M)
Jul 21 11:53:33 OpenWrt local2.info chat[10460]: expect (CONNECT)
Jul 21 11:53:33 OpenWrt local2.info chat[10460]: ^M
Jul 21 11:53:33 OpenWrt local2.info chat[10460]: ATD*99***1#^M^M
Jul 21 11:53:33 OpenWrt local2.info chat[10460]: CONNECT
Jul 21 11:53:33 OpenWrt local2.info chat[10460]:  -- got it
Jul 21 11:53:33 OpenWrt local2.info chat[10460]: send ( ^M)
Jul 21 11:53:33 OpenWrt daemon.info pppd[10455]: Serial connection established.
Jul 21 11:53:33 OpenWrt daemon.info pppd[10455]: Using interface 3g-wan
Jul 21 11:53:33 OpenWrt daemon.notice pppd[10455]: Connect: 3g-wan <--> /dev/ttyUSB0
Jul 21 11:53:36 OpenWrt daemon.warn pppd[10455]: Could not determine remote IP address: defaulting to 10.64.64.64
Jul 21 11:53:36 OpenWrt daemon.notice pppd[10455]: replacing old default route to eth1 [192.168.0.1]
Jul 21 11:53:36 OpenWrt daemon.notice pppd[10455]: local  IP address 41.151.67.64
Jul 21 11:53:36 OpenWrt daemon.notice pppd[10455]: remote IP address 10.64.64.64
Jul 21 11:53:36 OpenWrt daemon.notice pppd[10455]: primary   DNS address 196.43.34.190
Jul 21 11:53:36 OpenWrt daemon.notice pppd[10455]: secondary DNS address 196.43.46.190

To disconnect, type "ifdown wan".

Modify /etc/config/network - my final version looks as follows. This is so different users on the lan (wired) can access each other:
config 'switch' 'eth0'
        option 'reset' '1'
        option 'enable_vlan' '1'
config 'switch_vlan'
        option 'device' 'eth0'
        option 'vlan' '1'
        option 'ports' '0t 1 2 3 4'
config 'switch_vlan'
        option 'device' 'eth0'
        option 'vlan' '2'
        option 'ports' '0t 5'
config 'interface' 'loopback'
        option 'ifname' 'lo'
        option 'proto' 'static'
        option 'ipaddr' '127.0.0.1'
        option 'netmask' '255.0.0.0'
config 'interface' 'lan'
        option 'ifname' 'eth0.1'
        option 'type' 'bridge'
        option 'proto' 'static'
        option 'ipaddr' '192.168.1.1'
        option 'netmask' '255.255.255.0'
config 'interface' 'wan'
        option 'proto' '3g'
        option 'device' '/dev/ttyUSB0'
        option 'service' 'umts'
        option 'apn' 'internet'
        option 'pppd_options' 'noipdefault'
Finally configure 2 LEDs: Via the web interface on 192.168.1.1, choose System - LED configuration. Add two new:
name=3g, LED name=tl-mr3420:green:3g, trigger=net dev, device=3g-wan, trigger mode=link on
name=wifi, LED name=tl-mr3420:green:qss, trigger=net dev, device=wlan0, trigger mode=transmit+receive

For some reason there is no Wifi LED - we use the QSS LED instead.

Comments

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