Skip to main content

Posts

Showing posts from December, 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