Build ppa package

November 26, 2014 by · Leave a Comment
Filed under: Debian, Development, Linux, Ubuntu 

To build a package for ppa distribution, you need some tools. To “cross compile” for releases, for example i386 and amd64 packages on the same machine, takes some more work with schroot, dchroot etc. I’ll start with explaining how to create a “local” package for your own host, I’ll add another entry on how to do an i386 package from amd64. Everything is done on ubuntu 14.04 amd64 machine in this case, and I’m rebuilding dbus.

In short you need:

  1. apt-get install build-essentials dpkg-buildroot schroot gpg
  2. gpg –gen-key
  3. apt-get build-dep dbus
  4. mkdir dbus-amd64 && cd dbus-amd64
  5. apt-get source dbus
  6. export DEB_SIGN_KEYID=
  7. cd dbus-directory
  8. make changes.
  9. dch -i
  10. dpkg-source –commit
  11. dpkg-buildroot -i -I

If you plan on publishing your deb packages to launchpad or some such, you need to create an account and add a ppa. This is simple and done via the http://www.launchpad.net webpage. The webpage also gives you good upload information. Note that they require signed files, so signing must work for you first.

8. Create account on launchpad.
9. Export the gpg generated key to hkp://keyserver.ubuntu.com:11371 (easiest to do via Passwords and Keys tool
10. Import the key to launchpad using the key fingerprint.
11. Create a new PPA from the launchpad dashboard
12. dput ppa: dbus_1.6.18-0ubuntu4.4_source.changes

The package will be built by launchpad on its own, this may take some time..

DIY OSD

November 10, 2014 by · Leave a Comment
Filed under: Development, Robots 

I’ve built a DIY OSD based on Dennis Frie hardware and software released on rcgroups forum. I’m fairly happy with the results, the osd actually work. I do have some issues, but nothing serious. I have GPS, voltage sensors working as they should so far and am planning to add a current sensor and possibly rssi as well.

image

Top side not much to talk about. It’s an arduino pro mini 5v unit.

image

The GPS in the picture is not the one I’m using so far, but I will move over to it in a few days I hope, if I find the time. Main problem is that the GPS requires 3.3v,I’m running everything on 5v at the moment. I’m currently using a ublox neo7m from banggood. The picture shows how I hope to mount the GPS approximately though, depending on how I plan to mount OSD in comparison to the video link and the camera… GPS and video link should be mounted as far away from each other as possible, but OSD needs to be close to the video cable.

image

The bottom side. Most of the components have been sandwiched between the PCB’s. Some of the routing is a bit stupid but I’ll see if I can fix it so I can fit the current sensor somewhere on the bottom as well.

Remote DBus continued (using your own program)

November 7, 2014 by · Leave a Comment
Filed under: Communications, Development, Linux 

Continuing the previous thought on running DBus remotely using d-feet to check how it looks etc, this time, I wanted to call the DBus from my own program. Just write the DBus code as you would to query the DBus interface locally.

#!/usr/bin/env python

import dbus
import dbus.service
from dbus.mainloop.glib import DBusGMainLoop

BUS_NAME="org.freedesktop.DBus"
OPATH="/"

bus = dbus.SessionBus()
obj = bus.get_object(BUS_NAME, OPATH)
iface = dbus.Interface(obj, BUS_NAME)
lala = iface.GetId()
print lala

Then the magic comes in running the application.

DBUS_SESSION_BUS_ADDRESS="tcp:host=192.168.X.Y,port=Z" ./dbus-hello.py

DBus remote connection

November 5, 2014 by · Leave a Comment
Filed under: Communications, Development, General, Linux 

In a project I’m working on at the moment we wanted to remotely monitor a DBus session bus. The system in question has several buses available using different users and systemd. d-feet can connect and monitor remotely via TCP.  The following code will allow you to connect to a remote DBus on a target development board for example.

First copy the original session.conf to separate configuration files for each user.

cp /etc/dbus-1/session.conf /etc/dbus-1/session.conf.<username>
cp /etc/dbus-1/session.conf /etc/dbus-1/session.conf.<username2>

Then for each of the newly created configuration file, add the following configuration but with different port numbers and correct username director in /run/user. The ip address should be the IP of the connecting host, not the server. Edit session.conf.<username> and add:

<listen>tcp:host=<ip>,bind=*,port=<port>,family=ipv4</listen>
<listen>unix:path=/run/user/<username>/dbus/user_bus_socket</listen>
<listen>unix:tmpdir=/tmp</listen>

<auth>ANONYMOUS</auth>
<allow_anonymous/>

The systemd script is rewritten to use a specific conf file for the specific user trying to start the DBus.

Edit  /lib/systemd/system/dbus-session@.service and rewrite the ExecStart line as follows.

ExecStart=/usr/bin/dbus-daemon --config-file /etc/dbus-1/session.conf.%i --nofork

This allows you to connect using d-feet or other dbus applications (potentially, you should be able to connect for example other services over the network to the new DBus….).

Choose “connect to other bus” and use as bus address:

tcp:host=<targetIp>,port=<port>

Done. Hopefully.

Testing out RasPlex

November 2, 2014 by · Leave a Comment
Filed under: Communications, Linux 

I decided to try out RasPlex after having run OpenElec and RaspBMC for about half a year, and before that XBMCbuntu for a few years. I’ve been using plex server on my file server for a few months already and plex on the tablets/phones to stream movies, tv shows, etc while in bed. I haven’t had that much time with RasPlex yet, but I’m really impressed so far, especially when you start looking at what type of infrastructure it enables. I’m now using the same chain of applications for my tv, phones, tablets, and laptops, this is something I’ve never been able to before (if you except NFS/SMB solutions with VLC or some such video player, which has proven unstable for the phone/tablet cases in my case, high def videos will stutter a lot among other things).

My main problem with the entire setup is that my fileserver is a bit too weak to transcode 1080p on the fly, it is a D525 Atom CPU however, and I didn’t see this usecase when I bought it, so I’ll have to live with it for now ;).

All that said, I’m still very happy with XBMC, but I feel that RasPlex so far has given a more… mature feeling. It seems to work very well with no big hickups so far, the UI on RaspBMC and OpenElec was really slow, something that still holds true in RasPlex, but it is better.

Gps issues

November 2, 2014 by · Leave a Comment
Filed under: Communications, Development, Linux 

Been working for a few days with three different GPS modules (different builds etc) and I’m getting the same problem with all of them. They are pretty much giving out complete garbage at all settings. At 9600 bps 8n1 it gives out patterns at least. Just unreadable. I thought it might be ubx protocol but probably not.

I feel like I’m doing something really stupid but I can’t figure it out. Serial port problem? What else could be wrong?