Skip to main content

Posts

Showing posts from 2012

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

Bash script to send emails

It is possible to send emails directly from a bash script instead of using a third party email program. My first attempt was to use netcat to send data to the SMTP server. Netcat does almost the same as telnet, but telnet doesn't support input redirection (i.e. you can't send commands from a text file to the client - you have to manually type it). The problem with netcat is that it sends everything in a block - instead of waiting for a response from the server before sending the next command. In most cases it will work, but I did get instances where the email was not sent. Bash has a feature where you can open a TCP/IP connection directly from a script. It allows you to read & write to it, giving you all you need to interface with a SMTP server. See the code below for the send_mail procedure I'm using: #!/bin/bash send_mail () {   # $1 smtp server   # $2 smtp port   # $3 address from   # $4 address to   # $5 subject   # $6 body   if [ $# -ne 6 ]; th

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

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

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 r