This wiki hosts some of data I collect when I deal with a tricky challenge, or something I do not want to go through again. It happens a lot with hardware. Note that the material here is often a mash-up of existing material, but not always.

Frequent words (well, almost random links!)

Lastest posts

Transcend wifi SD card

This is an SD card than embeds a complete linux wifi server. It does not have many I/O though a few people hacked a serial line to the card (!).

IMHO it is not very reliable and has a very low wifi range, but that still makes an awesome piece of hardware!

Information

Disk /dev/sde: 16.1 GB, 16130244608 bytes
255 heads, 63 sectors/track, 1961 cylinders, total 31504384 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

   Device Boot      Start         End      Blocks   Id  System
/dev/sde1            8192    31504383    15748096    c  W95 FAT32 (LBA)

Enable telnet (UNSAFE remote logging)

To enable telnet logging to the card, just add the autorun.sh (with Unix line endings) to the root with this content:

#!/bin/bash
rcS6
tcpsvd -vE 0.0.0.0 21 ftpd -w /mnt/sd/ &
# Optionally install the latest busybox binary with more applets enabled
# cp /mnt/sd/busybox* /sbin/busybox
# chmod a+x /sbin/busybox
#### Obsolete
# /sbin/busybox telnetd -l /bin/bash &

Self made embedded programs on the SD card

To build an executable that works on the embedded ARM processor:

Install the required cross-development packages:

apt-get install gcc-arm-linux-gnueabi binutils-arm-linux-gnueabi

hello.c

#include <stdio.h>
int main ()
{
  printf("Hello ARM Cross Compiled!\n");
  return 0;
}

build.sh

arm-linux-gnueabi-gcc --static -o hello_arm hello.c
arm-linux-gnueabi-strip hello_arm

Misc

sudo mkdosfs -F 16 /dev/sde1
2014/03/12 09:55 · jeremie

SOftware for 3D printing and milling

Physics

Code_Aster modèle physique

Modelization

image to surface for openscad.

Visualization and post processing

Vizualization

Post-processing

2013/12/07 11:42 · jeremie

Raspberry I2C

Raspberry PI I2C clock with the nice and small "DS3231 For PI" RTC module.

# install teh I2C tools
apt-get install i2c-tools

Eg. howto (I2C for PI)

# Remove the module blacklist entry so it can be loaded on boot
sudo sed -i 's/blacklist i2c-bcm2708/#blacklist i2c-bcm2708/' /etc/modprobe.d/raspi-blacklist.conf

# Load the module now
sudo modprobe i2c-bcm2708

# Notify Linux of the Dallas RTC device
echo ds1307 0x68 | sudo tee /sys/class/i2c-adapter/i2c-1/new_device

Set the date like this:

hwclock --set --date '2013/11/12 10:31'

And query it:

hwclock

(I get Tue Nov 12 10:31:07 2013 -0.982126 seconds)

That's it! You can also add the i2c initialisation command to rc.local which means it will be run at every boot up;

# Add the RTC device on boot
sudo sed -i 's#^exit 0$#echo ds1307 0x68 > /sys/class/i2c-adapter/i2c-1/new_device#' /etc/rc.local
echo exit 0 | sudo tee -a /etc/rc.local

This doesn't cover automatically setting the clock on boot and but you can do so by adding another line (above exit 0) to rc.local with:

hwclock -s

Other clocks: http://www.framboise314.fr/avant-lheure-cest-pas-lheure-apres-lheure-offrez-une-horloge-temps-reel-rtc-a-votre-raspberry-pi/#more-1697

2013/11/12 12:21 · jeremie

Installation of linuxCNC on an old Dell Inspiron 4000

I have an old Dell inspiron 4000 laptop with a 1400x1050 screen (yeah) and 256MB RAM (huh), and it is the last stuff in my house that hosts a parallel port which is needed by linuxCNC. If/when it works, I will upgrade it to 512M (for about $6 on ebay, wow). BTW: my graphic chip is the ATI Rage Mobility M3 AGP 2x Rev2

Installinux linux on it was not straightforward.

I have no CD-ROMs in my house, and the laptop will not boot on USB keys. So I unscrewed the hardrive and attached it to my desktop with a quite convenient IDE-to-USB adapter. It was seen as an external USB drive then.

Using fdisk, I re-partitioned the disk to 3 zones:

  1. sda1 the forthcoming / partition (root+system+home)
  2. sda2 a swap zone (required to finish the installation!)
  3. sda3 the remaining for the system to install (and future home if needed)

Then unetbootin allowed me to install linuxcnc on the third partition. By the way I had also to copy the iso file to this partition, as the installer complained about not finding the CDROM during the install. Just switch to busybox console (control-alt-f2) and use a mount loop on the fake CDROM ISO file, switch back to the (control-alt-F7) and retry. If it fails, then you'll probably have to find a CDROM.

For the full-featured install I had to give it some swap (else it will fail):

sudo su -
mkswap -c /dev/sda2
swapon /dev/sda2

But then I switched to a shorter path: installed a alternate Kubuntu 10.04 I had around (by chance), and without the X server. The video was broken anyway, and I could then install XFCE instead of the memory-hungry gnome or KDE.

Once on the console:

apt-get install xfce

I did not try

This fails

To fix the video, I read that I could install the X11 fix from DELL (source: ref)

By the way, you can transfer the file with this on the source:

cat atimp310.rpm | nc -l 3333

And on the receiving side (if 192.168.99.99 is the IP of the source):

nc -n 192.168.99.99 > atimp310.rpm

Then on the target:

apt-get install alien
alien -i atimp310.rpm

But it gave no improvement on my side, the screen still was garbled.

This works

Create a file as /usr/lib/X11/xorg.conf.d/00-inspironfix.conf with this content.

You can leave the other sections, they do not seem to interfere enough to cause any issue.

So far I had a working inspiron 4000 running xubuntu on a nice 1400x1050 screen resolution.

To get to it remotely, I use openssh (telnet would eat less resources though):

apt-get install openssh-server

Next: linuxcnc

From linuxCNC, download on run this script.

It will update your apt sources and upgrade the kernel to something better suited to real time for controlling a CNC.

Reboot.

Install a CPU/Memory monitor: apt-get install xfce4-systemload-plugin

The latency from linuxcnc menu just does not run, I get nothing. Better run it in a console:

latency-test

OK, there is a problem with the realtime rtai_hal.ko kernel module (operation not permitted). When run as root, I still get the same message!

Though, uname -a says I do have a patched kernel:

Then fix a few things, from http://wiki.linuxcnc.org/cgi-bin/wiki.pl?TroubleShooting

Missing lapic: in /etc/default/grub, change

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
GRUB_CMDLINE_LINUX_DEFAULT="splash lapic"

afterwards run "sudo update-grub" and restart (I usually better prefer seeing lots of information than nothing, hence the removal of "quiet").

2013/11/01 16:39 · jeremie

Raspberry PI interface and GPIO ports

all this not sorted yet

GPIO and other ports: http://elinux.org/RPi_Low-level_peripherals

Raspberry/Arduino via I2C or serial link

Homemade PoE? check IEEE 802.3af. blue and brown/blue+white (unused) and brown+white (overvolting)

bcm2835.h: special and useful library http://www.airspayce.com/mikem/bcm2835/

Python and GPIO (source but fails to work), and pointers for Archlinux here

Pseudo digital-to-analog conversion via a dump RC (& python timings): http://www.raspberrypi-spy.co.uk/2012/08/reading-analogue-sensors-with-one-gpio-pin/#more-520

On-board hardware userful watchdog: http://blog.ricardoarturocabral.com/2013/01/auto-reboot-hung-raspberry-pi-using-on.html

Power

Add a capacitor to avoid brownouts (temporary voltage drop down that make the RPi reboot when hotpluggin USB devices).

Power the Raspi directly while keeping the polyfuse safety:

Screens

2013/10/12 14:21 · jeremie

<< Newer entries | Older entries >>


More about me on linkedIn or directly at jeremie francois at gmail. You may check my 3D printing-related blog and my designs, or a few spherical panoramas. Finally, TecRD is my company which helps small and big companies boost their computer-related research and development.

You could leave a comment if you were logged in.
start.txt · Last modified: 2013/09/26 16:27 by jim
 
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki