Posts By chikashi

Serial USB on Arch

When a serial USB device is inserted, the linux kernel detects it and put /dev/ttyACM0.
This is with rw-rw—- permission and this file belongs to uucp.
Thus, the user must include himself to the group uucp by

> sudo usermod -a -G uucp chikashi

relogin is required afterwards.

Electronic Components Distributors in Germany

http://digikey.com
– extremely high shipping cost (18 euro)
http://mouser.com
– extremely high shipping cost (20 euro)
http://www.arrow.com
– high shipping cost (11.95 euro)
http://www.ebv.com
– sales only large amount (more than 100)
http://de.futureelectronics.com
– sales only large amount (more than 100)
http://de.farnell.com
– very complicated procedure for getting a customer number

^ for toggling LED

How to use ^ operator
http://www.eskimo.com/~scs/cclass/int/sx4ab.html

The ^ (caret) operator performs a bitwise exclusive-OR on two integers. Each bit in the result is 1 if one, but not both, of the corresponding bits in the two input operands is 1. For example, 0x56 ^ 0x32 is 0x64:

0 ^ 0 = 0
0 ^ 1 = 1
1 ^ 0 = 1
1 ^ 1 = 0

Thus, PORTB ^= (1 << PB3) toggles the LED because if the LED is on(1) it returns 0, and it is off(0) it returns 1.

Auto login (Arch)

/etc/systemd/system/getty@tty1.service.d/autologin.conf
———————————-
[Service]
ExecStart=
ExecStart=-/usr/bin/agetty –autologin username –noclear %I 38400 linux
———————————-

to start lxde automatically

in .xinitrc
———————————-
exec startlxde
———————————-

to start application automatically after logging in;

~/.config/lxsession/LXDE/autostart
———————————-
@lxterminal  -e name of executable
———————————-

USB device and permission

The Peacock hardware is recognised as general human interface device and it is found under:

/dev/usb/hiddev0

> udevadm info -a /dev/usb/hiddev0

returns the info about the device: the most important info would be:

  • KERNEL==”hiddev0″
  • SUBSYSTEMS==”usb”
  • ATTRS{idVendor}==”03eb”
  • ATTRS{idProduct}==”204f”

You can test the rule by

> udevadm test /dev/usb/hiddev0

you will get errors if invalid commands are found in the rules

In order to open the permission of Peacock to all users

KERNEL==”hiddev[0-9]*”,SUBSYSTEM==”usbmisc”, SUBSYSTEMS=”usb”,ATTRS{idVendor}==”03eb”,  ATTRS{idProduct}==”204f”,MODE=”777″

Pattern for universal Xbee receiver

Pattern of 2 Xbee receiver

Pattern of 2 Xbee receiver

The left hand unit for Trombonist

This unit is designed for detecting the left hand movement (Wahwah effect with mute) of a trombone player.

Trombone

Trombone

First step towards the invisible piano

First step towards the invisible piano

First step towards the invisible piano

Interference between two P2P connections

I have experimented the interference between two pair of Xbee P2P connection.

If I use the same channel sometimes the delivery of packets is significantly delayed.

different channels

different channels

same channel

same channel

ATMega again

What I am trying to do now  is to merge the data from two Xbees and send them to the host computer as accurate and fast as possible. After the 14 hours of research I found out the  following two facts:

1. avoid to use one Xbee receiver to receive data from more than two Xbees. This slows down the speed radically

2. It is hard to receive and merge two channels of UART data without any packet loss using normal Arduino, because it has only one hardware uart.  Software uart is not reliable as far as I tested today.

My conclusion is to use ATMega 164P with two Hardware USART with big ring buffer (256 byte each!)  and enabled interruption now it works very fast

However… the PureData Interface freezes when I send data to it … I have to figure out the problem… but I guess it is pure data problem not the hardware.

AVR ATMega 164 with 2 Uarts

AVR ATMega 164 with 2 Uarts