Monthly Archives: July 2016

FritzBox Python Class Fritz OS 6.30+ syncing Google Calendar

This project allows to interact with your FritzBox above the new FritzOS 6.30 to 6.60 (tested with Fritzbox 7490 and 7390) by using a self written FritzBox Python Class. It furthermore uses the Google Calendar API to enter phonecalls and online devices status into your google calendar. To use the Google Services you will need to generate your own client api credentials including a valid calendar json. For the expected format see the provided default files.

Of course the FritzBox Python Script also works stand alone, an provides following functionality:

  • read out last 400 phone calls
  • list current network devices

Of course I plan to increase that functionality:

  • add a config.json
  • implement CalDav Support for non google solutions
  • add pictures of google calendar entries
  • enable gant charts of devices (d3js?)
  • get FritzBox phone book(s)
  • sync phone books to Google Contacts
  • sync phone books to CardDav

I’ve you are interested to use or join me developing:

https://github.com/PaulPetring/FritzBox

General Usage FritzBox python class

#constructors
box = FritzBox()
box = FritzBox("password") # should be default constructor
box = FritzBox("password", "username")
box = FritzBox("password", "username", "http://fritz.box")
box = FritzBox("password", "username", "http://fritz.box",false)

# getting a list of active devices as objects of FritzBoxDevice
devices = box.get_devices(self,"active")

# getting a list of passive devices as objects of FritzBoxDevice
devices = box.get_devices(self,"passive")

# getting a list of objects of FritzBoxCall
calls = box.get_foncalls()

# getting a list of objects of FritzBoxFonBookEntry
fon_book = box.get_fonbook()

General Usage Google Calendar Wrapper

For phone calls:

fon_calendar = GoogleCalendarWrapper("YOUR_CALENDAR_ID@group.calendar.google.com")
fon_events = fon_calendar.get_events()
handleFonEntriesToGoogleCalendar(fon_calendar,fon_events,calls)

For active devices tracking:

devices_calendar = GoogleCalendarWrapper("YOUR_CALENDAR_ID@group.calendar.google.com")
device_events = devices_calendar.get_events()
handleDeviceEntriesToGoogleCalendar(devices_calendar,device_events,devices)

 

This also works for multiple FritzBoxes, here you see all phone calls of a week:

FritzBox Python Class - calendar view

FritzBox Python Class – calendar view

It’s pretty easy to add this script to a raspberry pi located in the network of the router. You’ll also can setup an vpnc connection between the box and an server or use a dynamic ip and a custom port.

3 axis 28BYJ-48 ROS controllable flash light

I have found a bit older project of mine while browsing through my photos.. on a relatively unclean desk you can see a combination of two 28BYJ-48 motors, some screws, metal parts and a flashlight. Last of them could be replaced for example by a laserpointer, simple sensor or a distance measurement device.

Originally this was created to be placed on my amosero robot as a very simple form of an robot arm. Sadly work forced me to not follow that project side track any further which is why I can’t share more than these pictures: IMG_0068 Maybe some when if time allows, I will recreate this and make it more accessible.

Octoprint - M33-Fio - Raspberry Pi - select positions on the print bed

Running M3D Micro under Raspbian with Octoprint and MD3Fio plugin

The M3D Software is windows only, which causes a lot of wasted power by running a windows machine all time. After several and some successful attempts of running this software on a virtual machine inside my Linux, I figured out a much more easy way to print from a Raspberry Pi. It’s called Octoprint, but on an armhf basis requires a bit attention. In combination with the M33-Fio Plugin its serving perfectly as a printing server for the M3D-Micro I own.

Setting up your Raspberry Pi 3

To save me and you some time in future, I share the step by step code to set up an Raspberry Pi 3 with Octoprint from scratch. (even if there is an image down-loadable from Octroprint Website)

#allow pi user to communicate with printer via tty
sudo usermod -a -G tty pi
sudo usermod -a -G dialout pi

#install cura slicing engine by compiling it from source
cd ~
sudo apt-get install -y python-wxgtk2.8 python-numpy
git clone https://github.com/daid/Cura.git
cd Cura
#installing the requirements of Cura
sudo pip install -r requirements.txt
mkdir CuraEngine
cd CuraEngine
wget -OCuraEngine http://octoprint.org/files/octopi/cura_engine_14.12/cura_engine
chmod +x CuraEngine
cd ..
{ echo '#!/bin/sh'; echo 'PYTHONPATH=. python2 -m Cura.cura "$@"'; } > cura.sh
#also if we don't use the wrapper, we still make it executable
chmod +x cura.sh

#install octoprint
cd ~
sudo apt-get install -y python-pip python-dev python-setuptools python-virtualenv git libyaml-dev build-essential
git clone https://github.com/foosel/OctoPrint.git
cd OctoPrint
virtualenv venv
./venv/bin/pip install pip --upgrade
./venv/bin/python setup.py install
#install the requirements
sudo pip install -r requirements.txt
#install the m3d (or m33) fio plugin
sudo /usr/bin/pip install https://github.com/donovan6000/M33-Fio/archive/master.zip
mkdir ~/.octoprint
ufw allow 5000
./run

Start using Octoprint in browser

Start your browser at 127.0.0.1:5000 (or the ip of your rasbperry) and config Octoprint further:

Happy printing! With this combination of 3-5 Watt Raspberry Pi, and a maximum 20W M3D you can run the printer 24/7 without wasting more than a light bulb amount of power 🙂

Links: