Kategori HAL9k

24 mar

0 Comments

HAL9k; now with awesome electrical and network installation

Af

The local hacker space here in Aalborg (HAL9k) has moved from Rapsgade 1 to a permanent location at Sofiendalsvej 80. For a number of weeks we he been moving boxes of all our stuff, painting walls and other tasks related to the move. One of the things that I was involved in was the electricity installation and the computer network.

We have been so lucky to inherit a large number of metal and plastic cable trays including a number of Ethernet jacks and power outlets reducing the budget for establishing a new infrastructure at the new place.

After a lot of work, 50 m metal, 20 m plastic cable tray and 1,2 km Ethernet cable later we now have 74 ethernet jacks connected to our distribution frame with our two 48 port gigabit Dell switches connected to an OpenBSD firewall in VMware on our Dell R710 server, routing IPv4 and IPv6 (through a SIXXS tunnel). Thank you to Xena for the switches and the server.

The wireless network is handled by a 802.11a/b/g access point. The access point and the directional antennas are actually meant for outdoor usage, so we mounted it on an IKEA table leg to give it a touch of the rustic outdoor life on a large pole…
If you are curious about the details of the network setup check out the hal9k wiki here.

Besides the network installation we have also installed a new distribution board and a lot of power outlets. We have a dedicated power meter for the server room besides the three other power meters (which according to our plan will be monitored by our LIAB) and relays for the groups used in the workshops making integration with the physical access control system and emergency buttons easily done.

 

IMG_3762 IMG_4140 IMG_4145 IMG_4155 IMG_4156 IMG_4159 IMG_4171 IMG_4174 IMG_4180

 

 

 

 

 

 

Gemt under: Extern, HAL9k

Tags:

30 okt

0 Comments

POS printers and Python

Af

I had this old POS (Point Of Sale) receipt printer laying around for some time and thought it could be fun to play a bit with it. Printing plain text is simply done by sending it as characters via a serial connection. Cutting the paper is some ESC code which i found in a manual online. Printing images was a bit more tricky, since it is requires some specific codes, depending on how the dots in a vertical bar, equal to the height of a character, must be composed. I wrote a small Python module integrating the ability to print images, text etc.  since I could not find anything online simliar to what i wanted.

At the local hacker space (HAL9k) we have now received a large box full of used receipt printers, VFDs etc. and some of the members have asked for the module for printing images so I have uploaded pyPOSprinter to GitHub. It makes use of pySerial for communicating with the printer and Python Image Library for reading image files. The included example also shows how to use pyQRNative to print QR-codes (bar codes are soo last centory :-)  ).

from pyqrnative import PyQRNative
qr = PyQRNative.QRCode(5, PyQRNative.QRErrorCorrectLevel.Q)
qr.addData(“http://www.sman.dk”)
qr.make()
im = qr.makeImage()
ims = im.resize((525,525))
from POSprinter import POSprinter
printer = POSprinter.POSprinter()
printer.write(“Hello Puffy\n”, align=”center”)
printer.lineFeed(2)
printer.printImgFromFile(“puffy.gif”, resolution=”low”, scale=1.0)
printer.write(“Friske agurker paa glas”, rcolStr=”200 DKK”)
printer.lineFeed(2)
printer.printImgFromPILObject(ims, scale=0.5)
printer.lineFeedCut()

03 mar

Kommentarer lukket til Using QR codes at HAL9k

Using QR codes at HAL9k

Af

At the hackerspace in Aalborg (HAL9k) we wanted to mark equipment etc. with various information such as the owner of the equipment, possible instructions on how to use it and other relevant information.

We decided to make something based on stickers with QR codes where the user is redirected to the relevant subpage on HAL9k’s website. One requirement was furthermore that it should be possible to change the name of a wiki page or possibly change to a new wiki/CMS system without putting on a bunch of new stickers, i.e. something more dynamic than a direct link.

With regards to the stickers we ended up with a label printer attached to an Ubuntu Linux PC. We got 1300 stickers (resulting in 2600 QR codes) on Ebay for 350 DKK – enough stickers for the next foreseeable time..

Mikael from the hackerspace wrote some PHP code that we run locally on an Apache webserver on the PC, which basically generates a QR code (well actually two since we have two individual QR codes per sticker in order to end up with the right size), adds some (optional) text, saves the resulting image to a file and then calls the lp printing command.

The label printer was made to work with CUPS by using the instructions on this site.

Now back to the requirement about the desire not having to put new stickers on all the equipment when we change wiki/CMS, rename pages etc. We solved this by letting the QR codes point to http://qr.hal9k.dk/HQRxxx where ‘xxx’ is some number. The webserver at qr.hal9k.dk automatically redirects (307 Temporary Redirect) to the relevant page. In order not to have a manually maintained list that nobody would update anyway i wrote a Python script that every 5 minutes goes through all the pages on the HAL9k wiki using the page hal9k.dk/qr as an index. Every time it sees the string ‘HQR’ followed by a number on a given page, a reference is made and a .htaccess file is then updated so that the user is redirected to the correct page. The mappings between the keys and the wiki pages, logs etc. generated by the script is available at qr.hal9k.dk.

So the end result, besides having fun making it all, is that now users can easily print labels and put them on equipment at the hackerspace. If they forget to create the wiki page the user is automatically redirected to this page for a reminder about just that :-)