13 Dec 2014, 07:55

Airspy on Linux

Airspy is an SDR with amazing specs, but drivers are slowly coming to your prefered os.

This apply to Arch but should apply to any recent Linux.

I’ve first compiled libairspy but always had the error AIRSPY_ERROR_NOT_FOUND and "usbfs: interface 0 claimed by airspy while 'airspy_info' sets config #1"

Since Linux 3.17 comes with an airspy v4l autoloaded driver making impossible to use it with libusb: no airspy_info and no gqrx.

Simply get rid of it with a modprobe config like /etc/modprobe.d/airspy.conf

blacklist airspy

You need some deps: the airspy lib, gnuradio-osmosdr (gr-osmosdr) and a recent gqrx

Here are my Arch AUR pkg that will build airspy-git, gr-osmosdr-git and gqrx-git (note that you need to uninstall the packages from community to avoid conflict).

Have fun

28 Nov 2014, 20:29

FreeBSD on Google Compute Engine

First you need to create a VirtualBox FreeBSD install using a 10G qcow format, use an SCSI controller for the install as the disk will be visible as da0 inside GCE.

On FreeBSD 10.1 I had to load virtio manually, so set this in /boot/loader.conf

`virtio_load="YES"
virtio_pci_load="YES"
virtio_blk_load="YES"
if_vtnet_load="YES"`

Copy your ssh key in your home user .ssh/authorized_keys, be sure to be in the wheel group.

On a Mac you need to install GNU tar (brew install gnu-tar), shutdown your VirtualBox vm and upload your image to GCE

`VBoxManage clonehd -format RAW ../VirtualBox\ VMs/FreeBSDGCE/BSDGCE.qcow
~/Downloads/disk.raw
gtar -Szcf freebsd.tar.gz disk.raw
gsutil mb gs://bsdimage
gsutil cp freebsd.tar.gz gs://bsdimage/gce-bsd.tar.gz
gcutil addimage freebsd  gs://bsdimage/gce-bsd.tar.gz`

You should now see “freebsd” as available install image in your console

28 Jul 2014, 17:36

Simple APRS KK6NXK

APRS is a tactical digital communications system used between amateurs radio, to exchange positions & messages, here I blog my experience decoding/encoding APRS with a small Arduino as it may help some of you too.

Some transceivers are incorporating this functionalities but most of them don’t, a lot of new technicians start with cheap Baofeng radios (30$) which don’t provide advanced functionnalities but here is a way to solve that.

I’ve first looked at Bertos project, a realtime os for micro controllers as Atmel 328p (Arduinos), you can see my 1st attempt there:

This was the receiver only, a simple divider, the “hard” part was to understand the Baofeng/Kenwood mic jacks.

It takes me a long time to figure out that the Baofeng was too slow to trigger the squelch, so the Arduino missed the beginning of the message, hopefully I have a Kenwood too …

So for a Baofeng using this kind of APRS decoder, you have to disable the squelsh completly, and set the volume very high it has to reach a proper signal on the arduino around -3v/+3v.

For the AFSK modulation, the Bertos project use a DAC made with 4 resistors.

Later, I’ve discovered the wonderful work of Mark Qvist MicroAPRS, mostly the same circuit as the Bertos project but with an awesome documentation of the code, it’s a pleasure to read & learn.

So I’ve started to work on a circuit using a Bluno Nano an Arduino Nano with Bluetooth Low Energy, as an iPhone developer, this piece of electronics is just incredible and gives me the capabilites to connect my circuits to iphone Apps.

It’s working but hardly a mobile solution :)

Later I’ve designed a PCB for it you can find the full Gerber files in my Github.

I’m using Frizting to design and then export to OSHPark for the PCB manufacturing, it’s far from perfect but I will improve the circuit and publish it soon !

This plus an iPhone app and you’ll rock APRS !

73 de KK6NXK

08 Jul 2014, 01:22

Got my amateur radio license KK6NXK

When I was a young child, I remember listening to an old radio receiver with my grandfather, looking for morse transmission.

30 years later, I take the opportunity to get my radio amateur license in the US, it was not difficult (Technicial license is easy), especially cause US radio amateurs are using the metric system (almost all the time …), the only difficulties were to learn some terms and simple formulas from french to english and to know some parts of regulation by heart (I have never been able to learn by heart).

A lot of people keep asking me why are you doing this? Do you want to speak to a microphone to a stranger?

First why not, it’s not the craziest thing I’ve ever done :)

Then they probably have forgotten that every single piece of technology today are using radio waves, from your 4G phone to wifi to Bluetooth, learning and understanding that is really useful.

For example Radio amateur bands overlap some of the “civil” bands, it gives some extended privileges to a radio amateur to experiment with long distance wifi transmissions.

So it’s not just about voice but data too.

Another aspect is electronic, a lot of radio amateur are sharing hardware and electronic circuits to build your own receiver/transceiver, before it was cool on the Internet.

Learning electronic to build something real is a lot more rewarding than it was at school…

Even without a license this is a brand new world to explore, receiving satellite images of the Earth is one of the many possibilities you can get entering radio world.

This is the beginning of a new knowledge branch to conquer !

See my work on an APRS bluetooth Modem

73 de KK6NXK

By the way in french it’s radio amateur and not amateur radio :)

19 Feb 2014, 05:05

FreeBSD 10 on Dedibox SC gen 2 or any remote server with a rescue shell

FreeBSD 10 is out and it’s time to replace your Linux boxes cheeky

SC gen 2 is a VIA U2250 with 2Gb memory.

Start the rescue shell in amd64 12.04 Ubuntu, connect to the box via SSH with the temporary password

sudo -s
cd /tmp
wget http://ftp1.fr.freebsd.org/pub/FreeBSD/snapshots/ISO-
IMAGES/10.0/FreeBSD-10.0-STABLE-amd64-20140216-r261948-disc1.iso
apt-get update
apt-get install qemu-kvm

sudo qemu-system-x86_64 -no-kvm -hda /dev/sda -cdrom ./FreeBSD-10.0-STABLE-
amd64-20140216-r261948-disc1.iso -net nic,model=e1000 -vnc :1,yourpassword
-boot d

This install qemu and run the FreeBSD installer from the downloaded CD.

Run a VNC client on your computer and connect to your dedibox ip, you should watch FreeBSD boot from the CDROM.

Complete a normal installation, at the end it will ask if you want to run a shell **answer is YES **and then type this to reinstall the bootloader.

If you are using UFS (default)

fdisk -B -b /boot/boot0 /dev/ada0

If you are using ZFS:

gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i 1 ada0

Type exit and reboot to the normal mode.

Happy FreeBSD !

Further notes:

  • If you are not using ZFS, you can enable softupdate and TRIM as the SC gen 2 contains an hybrid SSD, you should theoretically have better performance
  • The last fdisk command is not the normal process but it was the only way I get it boot
  • Do not use qemu with KVM as there is a bug with this particular cpu, so yes the installation will be dead slow
  • The DHCP won’t answer it’s ok

30 Jan 2014, 17:37

FreeBSD on RaspBerry Pi

FreeBSD images for arm are now built from the FreeBSD Foundation ! So it’s an easy process to get it on your Pi.

Download your image from the ftp repository

Insert a 4Gb or more SD card in your PC and copy the FreeBSD image into it, here are the commands for a Mac:

sudo diskutil list​
sudo diskutil unmountDisk /dev/disk1​
sudo dd if=/Users/akh/Downloads/FreeBSD-10.0-STABLE-arm-
armv6-RPI-B-20140127-r261200.img  of=/dev/rdisk1 bs=1m​
sudo diskutil eject /dev/disk1​

Boot your pi with the card and welcome to FreeBSD !

If you are using the wifi dongle from Adafruit this may help:

echo legal.realtek.license_ack=1 >> /boot/loader.conf
echo wlans_urtwn0="wlan0" >> /etc/rc.conf
echo ifconfig_wlan0="wpa DHCP" >> /etc/rc.conf`

And set your wifi password with wpa_passphrase

wpa_passphrase yourssid yourwifipassword >> /etc/wpa_supplicant.conf

15 Jun 2013, 17:59

7shape my first iphone application

As an iphone developer contractor, I’ve released some applications on the Apple Store for my customers but not on my own.

Here is my 1st personal (30 hours) toy project: 7shape a 7 minutes workout training application, based on an NYT blog post.

I’ve spent 20 hours on website release, marketing, 3D for the human trainer and application design, and last 10 hours to create the app and release it to Apple …

It’s a free app and available on the Apple Store, have fun.

My next personal project will be a game, stay tuned ;)

24 Apr 2013, 18:51

Enhance your Go

After my Enhance your Python post, which is my Python bible reference, I wanted the same for Golang:

Last edit: 2014 February

19 Feb 2013, 16:53

Remove keys from a list of dicts in Python

I often have this need to remove some keys from a list of dict, like cleaning it before passing it.

Comment on Gist

14 Feb 2013, 19:20

My developer tools (Mobile)

As a day to day Python and iOS developer, I’m using a lot of tools on my Mac, here is a list that could help you too.

  • Textmate 2, Free, it’s funny to see that most people don’t know Textmate 2 is open source and totally free, this is a wonderful editor with completion and support for most languages.
  • SublimeText 2, free/pay, I’ve switched to Sublime mostly for the Golang support with Gosublime and not regreting it. It’s my editor of choice for almost everything now.

  • Colorsnapper, 5$, is a color picker, that can produce CSS RGB code, UIColors .. in your clipboards.

  • XScope, 30$, it’s a multi purposes tool but the measure tool is the killer feature it can measure everything on your screen (using color recognition), has also a mirror iphone app to see your design live, rulers … Useful to track mistakes from your designer.

  • Skitch, Free, it was a killer app until evernote acquires this company, Skitch 2 is a mess, but the app helps a lot, capture a region of your screen, share it with a link to your designer/devs … Some of my buddies are using CloudApp to do the same.

  • Developer color picker, Free, A custom color picker designed specifically for developers. Currently supports NSColor, UIColor, CGColorRef, CSS and HTML styles.

  • Google Drive, Free, You probably knew it, but many don’t know there is a native sync app exactly like Dropbox. I’ve switched from Dropbox to Google Drive: all documents in one place, complex documents editor and cheaper than DropBox.

  • AppCode, 99$ yearly, If you are developing for iOS, try the 30 days demo, it will blow your mind, this editor is smart and really help you, show you missing translations, show you missing @2x images, totally customizable, Jetbrains knows what is an editor, this is what XCode should be.
    Since Apple is pushing the use of XIB and Interface builder, I don’t recommend AppCode anymore, but still a great product.

  • Paintcode, 99$, Draw rectangle, beziers path, fill it with gradients, Paintcode will generate the Objective C code for you. It can be a real saver if you have a lot of custom drawing in your app. An optionnal PSD import is available in app purchase for 20$, works well but don’t expect to much, it will help you not code for you smiley.

  • Tower, 40$, Git is nice, but when it comes to fast forward your cherry pick, you propably need help (or avoid git and use mercurial which has normal messages), tower is a nice interface to git.

  • P4Merge, Free, A visual merge tool from perforce, that you can use with git.

  • Pycharm, 99$ yearly, I’m used to vim or Textmate for almost everything but as with Objective-C, Jetbrains is doing an incredible job in the Python ecosystem, supporting Jinja2 templates, Google App Engine or Django, this is my default editor in Python, it’s worth it.

  • Objectify, 5$, Give it a JSON, it will generate Objective-C model, to be honest I’m not using it but it may help.

  • Sketch, 50$, It’s a recent acquisition, Sketch is a vector graphics editor, it was primary for me a solution to open PSD, it works but you can only export with it (wil generate iOS @2x for you). What is incredible with this tool? I’m not a design guy and don’t know how to draw, everything I do with Photshop is ugly but I’m able to draw shapes usable in my work with Sketch ! This is totally new to me, this is the right tool for me.

  • Gimp, Free, Since Gimp is native on OSX, it’s totally usable but the PSD imports is messy. (PSD seems to be the ugliest file format in the world), Pixelmator is an option but again PSD import miss a lot of functionalities like effects.

  • ImageOptim, Free, Gain half the size of your PNG in your iOS app, but remember to disable XCode PNG compression.

  • NSLogger, Free, It’s is a high perfomance logging utility which displays traces emitted by client applications running on Mac OS X or iOS (iPhone OS). It replaces your usual NSLog()-based traces and provides powerful additions like display filtering, image and binary logging, traces buffering, timing information, etc

  • HTTPie, Free, Command line, cURL for human, debug REST API, test your webserver, this is what you need

  • Flu.x, Free, As a developer you are working late, it will change the color temperature of your screen according to the time of the day, think about your circadian rhythm.

  • Dash, 6$, Search inside documentation for almost everything, Cocoa, js, python … Really fast and has plugins for Alfred !

You probably have understood, I like Jetbrains products, AppCode & PyCharm, there is a Java for Android free community edition of IDEA, what I like too for this editors is the possibility to use the same colors everywhere thanks to Solarized, I’m used to Dark Solarized in XCode, iTerm2, Jetbrains products and Textmate2.

There are a lot more tools for developers on CLI but this is the my main list !

EDIT: updated on August 9th 2013