tag:blogger.com,1999:blog-278535482024-02-08T03:00:59.118+01:00Erl's BlogThe meanderings of a geek.Erland Lewinhttp://www.blogger.com/profile/17524137346314761155noreply@blogger.comBlogger77125tag:blogger.com,1999:blog-27853548.post-54043088458897578112019-11-26T09:12:00.002+01:002019-11-26T09:12:15.045+01:00Building Bluetooth Mesh example for nRF52840 Dongle on a MacContinuing my story of getting started developing for the nRF52840 on my Mac.<br />
<br />
I'm trying to follow instructions <a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.meshsdk.v3.2.0%2Fmd_doc_getting_started_mesh_quick_start.html">here</a>, but they don't cover the Mac specifically, just Linux and Windows and say "<span style="background-color: white; color: #474747; font-family: "open sans" , "calibri" , "arial" , sans-serif; font-size: 16px;">The steps should be similar for other platforms". Disappointing.</span><br />
<span style="background-color: white; color: #474747; font-family: "open sans" , "calibri" , "arial" , sans-serif; font-size: 16px;"><br /></span>
<span style="background-color: white; color: #474747; font-family: "open sans" , "calibri" , "arial" , sans-serif; font-size: 16px;">First attempt at generating build files with cmake used (in the newly manually created build directory under the mesh SDK):</span><br />
<span style="background-color: white; color: #474747; font-family: "open sans" , "calibri" , "arial" , sans-serif; font-size: 16px;"><br /></span>
<style type="text/css">
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px Menlo; color: #000000}
span.s1 {font-variant-ligatures: no-common-ligatures}
</style>
<br />
<div class="p1">
<span class="s1">cmake -DTOOLCHAIN=gccarmemb -DPLATFORM=nrf52840_xxAA -DSDK_ROOT=<sdk 16="" dir=""> ..</sdk></span></div>
<div class="p1">
<br /></div>
It worked, but generated files for the 10056 board instead of the 10059 board which is the dongle. Unfortunately there doesn't seem to be a board file for the 10059 board in the mesh SDK directory CMake/board<br />
<br />
I copied the pca10056.board file there to pca10059.board, replacing the strings 10056 to 10059 in it. I also edited the nrf52840 section of the CMake/Board.cmake file to be:<br />
<br />
<style type="text/css">
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px Menlo; color: #000000}
span.s1 {font-variant-ligatures: no-common-ligatures}
</style>
<br />
<div class="p1">
<span class="s1">elseif (PLATFORM STREQUAL "nrf52840_xxAA")</span></div>
<div class="p1">
<span class="s1"><span class="Apple-converted-space"> </span>set(BOARD "pca10056" CACHE STRING "Board to build examples for.")</span></div>
<div class="p1">
<span class="s1"><span class="Apple-converted-space"> </span>set_property(CACHE BOARD PROPERTY STRINGS "pca10056" "pca10059")</span></div>
<br />
and then reran cmake thus (in the newly created build directory):<br />
<br />
<style type="text/css">
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px Menlo; color: #000000}
span.s1 {font-variant-ligatures: no-common-ligatures}
</style>
<br />
<div class="p1">
<span class="s1">cmake -DTOOLCHAIN=gccarmemb -DPLATFORM=nrf52840_xxAA -DSDK_ROOT=<i><my directory="" installation=""></my></i>/SDK16 -DBOARD=pca10059 ..</span></div>
<br />
Looks good. It says it's using SDK15 even though I gave it the path to SDK16, but I'll try it this way.<br />
<br />
I then run make in the build directory.<br />
<br />
I get errors related to LED_START and LED_STOP. Seems board related.<br />
<br />
See <u><a href="https://devzone.nordicsemi.com/f/nordic-q-a/54773/led_start-and-led_stop-are-not-defined-in-pca10059-h">my posting on the Nordic forum about this</a></u> with a fix.<br />
<br />
I got further in the compilation, now got an issue about missing symbols.<br />
I added the path to nrfjprog and mergehex to my path, and reran cmake. Note that you need to add the subdirectories for nrfjprog and mergehex separately.<br />
<br />
I still get a warning during build:<br />
<style type="text/css">
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px Menlo; color: #000000}
span.s1 {font-variant-ligatures: no-common-ligatures}
</style>
<br />
<blockquote class="tr_bq">
<span class="s1">warning: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: warning for library: librtt_nrf52840_xxAA.a the table of contents is empty (no object file members in the library define global symbols)</span>
</blockquote>
<div class="p1">
<span class="s1"><br /></span></div>
<div class="p1">
<span class="s1">and then later errors starting with:</span></div>
<blockquote class="tr_bq">
<span class="s1">/usr/local/gcc-arm-none-eabi-9-2019-q4-major/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld: CMakeFiles/beaconing_nrf52840_xxAA_s140_6.1.1.dir/__/__/mesh/prov/src/prov_utils.c.obj: in function `prov_utils_keys_generate':</span><span class="s1">/<i><...></i>/mesh_3.2.0/mesh/prov/src/prov_utils.c:230: undefined reference to `uECC_secp256r1'</span></blockquote>
<span class="s1">and later also complaining about missing </span>
<br />
<blockquote class="tr_bq">
<span class="s1">/<i><...></i>/mesh_3.2.0/mesh/core/src/log.c:63: undefined reference to `SEGGER_RTT_printf'</span></blockquote>
I believe I need to link with <span class="s1" style="font-family: Menlo; font-size: 13px;">$(</span><span class="s2" style="font-family: Menlo; font-size: 13px;">SDK_ROOT</span><span class="s1" style="font-family: Menlo; font-size: 13px;">)/external/nrf_cc310_bl/lib/cortex-m4/hard-float/libnrf_cc310_bl_0.9.12.a</span><br />
(found this out from examples/crypto/nrf_cc310_bl/pca10056/blank/armgcc/Makefile)<br />
<br />The mesh SDK also built build/external/micro-ecc/libuECC_nrf52840_xxAA.a<br />...and it's on the build line. Don't know why it isn't working. Ask Nordic?<br /><br />The trick was to surround the linked archives for uECC and RTT with
<style type="text/css">
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px Menlo; color: #000000}
span.s1 {font-variant-ligatures: no-common-ligatures}
</style>
<div class="p1">
<span class="s1">-Wl,--whole-archive and </span><span style="font-variant-ligatures: no-common-ligatures;">-Wl,--no-whole-archive</span></div>
<style type="text/css">
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px Menlo; color: #000000}
span.s1 {font-variant-ligatures: no-common-ligatures}
</style>
<div>
<br /></div>
<div>
<br />
<style type="text/css">
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px Menlo; color: #000000}
span.s1 {font-variant-ligatures: no-common-ligatures}
</style><style type="text/css">
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px Menlo; color: #000000}
span.s1 {font-variant-ligatures: no-common-ligatures}
</style><br />
<style type="text/css">
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px Menlo; color: #000000}
span.s1 {font-variant-ligatures: no-common-ligatures}
</style><style type="text/css">
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px Menlo; color: #000000}
span.s1 {font-variant-ligatures: no-common-ligatures}
</style></div>
<style type="text/css">
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px Menlo; color: #000000}
span.s1 {font-variant-ligatures: no-common-ligatures}
</style><style type="text/css">
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px Menlo; color: #000000}
span.s1 {font-variant-ligatures: no-common-ligatures}
span.s2 {font-variant-ligatures: no-common-ligatures; color: #ba8c1c}
</style>Erland Lewinhttp://www.blogger.com/profile/17524137346314761155noreply@blogger.com0tag:blogger.com,1999:blog-27853548.post-88158781037280408592019-11-22T22:11:00.001+01:002019-11-22T22:24:50.928+01:00Nordic SDK16, nrRF52840 Dongle and gcc on a MacI just got some nRF52840 dongles that I ordered (for about €9 each).<br />
<br />
This is a log of my first step of building and programming the 'Blinky' app to it on a Mac, using gcc rather than the Segger Embedded Studio.<br />
<br />
I downloaded Nordic's latest nRF5 SDK (version 16) from <a href="https://www.nordicsemi.com/Software-and-tools/Software/nRF5-SDK/Download#infotabs">here</a>.<br />
<br />
Downloaded the latest gcc toolchain from ARM from <a href="https://developer.arm.com/tools-and-software/open-source-software/developer-tools/gnu-toolchain/gnu-rm/downloads">ARM</a>.<br />
<br />
Uncompressed the archive.<br />
<br />
Copied resulting directory to /usr/local:<br />
<style type="text/css">
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px Menlo; color: #000000}
span.s1 {font-variant-ligatures: no-common-ligatures}
</style>
<br />
<blockquote class="tr_bq">
<span class="s1">cp -a gcc-arm-none-eabi-9-2019-q4-major /usr/local</span></blockquote>
In the SDK (SDK16) directory, under components/toolchain/gcc: Backed up Makefile.posix, edited it to read:<br />
<div class="p1">
<span class="s1">
<style type="text/css">
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px Menlo; color: #000000}
span.s1 {font-variant-ligatures: no-common-ligatures}
</style>
</span></div>
<blockquote class="tr_bq">
<span class="s1">GNU_INSTALL_ROOT ?= /usr/local/gcc-arm-none-eabi-9-2019-q4-major/bin/</span><span class="s1">GNU_VERSION ?= 9.2.1</span><span class="s1">GNU_PREFIX ?= arm-none-eabi</span></blockquote>
Go to the SDK, directory examples/peripheral/blinky/pca10059/mbr/armgcc<br />
<br />
The makefile is already adapted to the board, so we don't need to follow the instructions <a href="https://devzone.nordicsemi.com/nordic/short-range-guides/b/getting-started/posts/nrf52840-dongle-programming-tutorial">here</a> regarding setting flash start etc.<br />
<br />
Run make. It worked! To upload the files to the board:<br />
<ul>
<li>Start the nRF for Desktop app, </li>
<li>Start the programming mode within it, </li>
<li>select the device in the drop down, </li>
<li>drag the .hex file from the _build directory that make generated to the nRF Connect app</li>
<li>Click 'write'</li>
</ul>
<div>
I think it works! </div>
<div>
<br /></div>
<div>
The on board LED changes color red / green / white blue-green / blue / black. </div>
<div>
<br /></div>
<div>
Next step: get a Bluetooth Mesh example app running.</div>
<div>
<br /></div>
<br />
<div class="p1">
<br /></div>
<style type="text/css">
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px Menlo; color: #000000}
span.s1 {font-variant-ligatures: no-common-ligatures}
</style>Erland Lewinhttp://www.blogger.com/profile/17524137346314761155noreply@blogger.com0tag:blogger.com,1999:blog-27853548.post-39570318373726552892017-02-26T00:19:00.000+01:002017-02-26T00:20:52.316+01:00Building xpilot classic on Ubunut 15.04<span style="font-family: Courier New, Courier, monospace;">sudo apt-get install libx11-dev xutils-dev libxext-dev</span><br />
<br />
Download <a href="https://sourceforge.net/projects/xpilotgame/?source=typ_redirect">xpilot classic from SourceForge</a>, Unpack.<br />
<br />
<span style="font-family: Courier New, Courier, monospace;">xmkmf -a</span><br />
<span style="font-family: Courier New, Courier, monospace;">make</span><br />
<br />
I got:<br />
<blockquote class="tr_bq">
<span style="font-family: Courier New, Courier, monospace;">Error in textinterface.c: getline conflicts with builtin</span></blockquote>
Replace all occurences of 'getline' with 'getline2' in src/client/textinterface.c<br />
<br />
Then make. Works!<br />
<br />Erland Lewinhttp://www.blogger.com/profile/17524137346314761155noreply@blogger.com0tag:blogger.com,1999:blog-27853548.post-4112324458159837162015-07-31T11:43:00.001+02:002015-08-02T22:38:47.983+02:00Experimenting with PLAI'm experimenting with PLA filament on my Printrbot Classic 3D printer. Slicing with Slic3r 1.2.9. Printing with Octoprint.<br />
<br />
Filament is not sticking to bed. The model is large but small surface area - basically a third of the perimeter of a circle with radius 100 mm, perimeter is 2 mm wide. I also have a new fan assembly which is not perfect.<br />
<br />
Bed measured temp is around 71. Hotend temp set to 215.<br />
<br />
Set first layer speed changed from 25% to 15 mm/s. Retry.<br />
<br />
I think head was too far from bed. Changed G92 Z-1.6 to G92 Z-1.5 in printer init script.<br />
<br />
filament is coming out of printhead unevenly - in globs.<br />
<br />
Removing fan assembly. Reducing printhead temp to 210 to try to reduce uneven PLA flow. Changed G92 Z-1.5 to G92 Z-1.45. Reducing max print speed from 120 to 80 mm/s.<br />
<br />
First layer still not sticking properly. Still uneven flow.<br />
<br />
Lower printhead even more, to Z-1.35. Globbing could be because not sticking properly?<br />
<br />
Still not good. Unsure if the G92 Z stuff is having an effect. Perhaps I should go out and buy blue painters' tape or hair spray.<br />
<br />
Changed to G92 Z-1.1. Still looks the same.<br />
<br />
Now tried adjusting Z-stop screw instead of G92. Removing G92 command. Retry.<br />
<br />
That seems to have done it!<br />
<br />
Continued experiments:<br />
<br />
Added a spoke to the model. Changing first layer speed from 15 to 20 mm/s. Changing max speed from 80 to 100. Calculate volumetric speed equivalent of 100 mm/s: cylinder 2.85 mm diameter x 100 mm volume = 638 mm^3 / s. Test with 638. Increasing layer height to 0.4 mm.<br />
<br />
Worked fairly well. Print time 44 minutes. Extruder stepper was losing steps when printing the smaller top part. That part also turned out poorly, probably no fan caused it not to have time too cool down. For the next one, try a minimum layer time (30 second layers were good, 5 second layers were bad), slower volumetric speed, try even higher layers (0.5 mm).<br />
<br />
Changed minimum layer time to from 5 to 30 seconds, max volumetric speed to 500, first layer speed to 20, layer height to 0.5, default extrusion width to auto. Print time will now be about 90 layers * 30 seconds = 45 minutes.<br />
<br />
The extruder stepper is still losing steps. I don't understand why. Stepper motor weak because it is hot? trying decreasing pressure holding filament against knurled bolt in extruder. I think reducing this pressure fixed the problem.<br />
<br />
Note to self: next time, thread the filament from the spool, through the 'b' in the pb (PrinterBot) logo on the Power Tower, so that the filament is not pulled sideways off the spool.<br />
<br />
Worked well. Slower layer times appear to be an alternative to having a fan.<br />
<br />
Continued experiments 2015-08-02<br />
<br />
Made a fan attachment model in FreeCAD (fairly difficult design for me). Printing with 30% infill. Increasing layer height from 0.5 to 0.6 mm, max print speed from 100 to 120, max volumetric speed to 550, first layer speed from 20 to 25 mm/s.<br />
<br />
Extruder skipped. Raised extruder temp to 215. Head was too far from printbed. Needed to back off on Z-screw 1.5 turns.<br />
<br />
Got a printout. It was pretty rough, stringy. Some parts of layers didn't attach properly. Dimensions were not very accurate. Maybe 0.5 layer is just too rough. Trying to print it at 0.3 mm. Max print speed at 100, max volumetric speed 500, first layer speed to 30 mm/s.<br />
<br />
Printout turned out fairly well. A bit of unevenness, but OK for a structural part that doesn't have to be pretty.<br />
<br />
Changing seam position to nearest, decreasing filament temperature from 215 to 213. Increasing first layer speed to 40 mm/s, decreasing diameter from 2.85 to 2.83 to decrease extrusion. Decreasing bed temp from 42 to 40 (Note that my temp sensor is wacky, so this is not the actual temperature), don't combine infill (so little infill anyway in this model). Sent to printer, will print tomorrow.<br />
<br />Erland Lewinhttp://www.blogger.com/profile/17524137346314761155noreply@blogger.com0tag:blogger.com,1999:blog-27853548.post-71185343793483734642015-07-28T21:18:00.000+02:002015-07-28T21:18:17.253+02:00Raspberry Pi troubles solvedAfter updating the software (using apt-get) on the Raspberry Pi I use to run OctoPrint to control my 3D printer, it would not recognize my TPLink USB WiFi dongle.<br />
<br />
Turned out that the firmware needed for it has been removed from the Raspberry Pi kernel, so the fix as presented <a href="https://github.com/raspberrypi/linux/issues/764" target="_blank">here</a> was to do:<br />
<br />
<pre style="background-color: #f7f7f7; border-radius: 3px; box-sizing: border-box; color: #333333; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 11.8999996185303px; font-stretch: normal; line-height: 1.45; margin-bottom: 16px; overflow: auto; padding: 16px; word-wrap: normal;"><code style="background: transparent; border-radius: 3px; border: 0px; box-sizing: border-box; display: inline; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 11.8999996185303px; line-height: inherit; margin: 0px; max-width: initial; overflow: initial; padding: 0px; word-break: normal; word-wrap: normal;">sudo wget https://github.com/lwfinger/rtl8188eu/raw/c83976d1dfb4793893158461430261562b3a5bf0/rtl8188eufw.bin -O /lib/firmware/rtlwifi/rtl8188eufw.bin</code></pre>
I had some other problems too, apparently I must have powered down the RPi messily. I had to use the Mac's Disk Utilities to repair the boot partition (Windows FAT format), then load a Linux virtual machine and copy the start.elf file from another copy of the distribution to my boot partition.<br />
<br />
<br />
<br />Erland Lewinhttp://www.blogger.com/profile/17524137346314761155noreply@blogger.com0tag:blogger.com,1999:blog-27853548.post-53110445608112316892015-01-25T23:12:00.001+01:002015-01-25T23:12:49.413+01:00Using an Arduino 32u4 as a Visual Pinball controllerI'm building a <a href="http://www.vpforums.org/" target="_blank">Visual Pinball</a> cabinet, and I'm planning to use an <a href="http://www.arduino.cc/" target="_blank">Arduino</a> Compatible board (a <a href="https://www.pololu.com/" target="_blank">Pololu</a> <a href="https://www.pololu.com/product/3101" target="_blank">A-Star 32U4 Micro</a>) as a controller. The Arduino will appear as a USB keyboard, joystick and Media remote to convert button pushes to keyboard presses, plunger position to joystick movements, and volume knob rotations to volume controls on the PC.<br />
<br />
I may later try to use the Arduino as an output device as well, to control a lit button, and some solenoids.<br />
<br />
I've found the following sites with information:<br />
<ul>
<li>Keyboard: <a href="http://arduino.cc/en/Reference/MouseKeyboard" target="_blank">The Arduino Mouse and Keyboard libraries</a></li>
<li>Joystick: <a href="http://www.imaginaryindustries.com/blog/?p=80" target="_blank">This blog entry</a> (with code)</li>
<li><a href="http://stefanjones.ca/blog/arduino-leonardo-remote-multimedia-keys/" target="_blank">Arduino Leonardo Remote Control (Multimedia Keys) Support for Arduino 1.0.5</a></li>
</ul>
So, all information seems to be available.<br />
<br />
The second two links both require modifying two files (in the Arduino installation. Too bad the software is not flexible enough to support using new USB device types without modifying the distribution.<br />
<br />
I forked the Arduino stable (1.0.6) distribution on GitHub <a href="https://github.com/pilotniq/Arduino" target="_blank">here</a>.<br />
<br />
I've pushed my untested changes. To be continued.Erland Lewinhttp://www.blogger.com/profile/17524137346314761155noreply@blogger.com0tag:blogger.com,1999:blog-27853548.post-34486069167471557702014-10-26T22:55:00.002+01:002014-10-26T22:55:49.772+01:00Adding a new disk to an LVM Ubuntu systemToday I'm adding another disk to my main Linux server.<br />
<br />
I used cgdisk to write a partition table. I set the partition type to 8e00 for LVM (Logical Volume Manager?)<br />
<br />
<div class="p1">
sudo pvcreate /dev/sdb1</div>
<div class="p1">
<br /></div>
<div class="p1">
$ sudo lvcreate --extents 100%FREE -n lvdisk2 vgdisk2 </div>
<div class="p1">
</div>
<div class="p1">
Logical volume "lvdisk2" created</div>
<br />
<div class="p1">
$ sudo vgcreate vgdisk2 /dev/sdb1</div>
<br />
<div class="p1">
Volume group "vgdisk2" successfully created</div>
<div class="p1">
<br /></div>
<div class="p1">
</div>
<div class="p1">
sudo mkdir /mnt/disk2</div>
<div class="p1">
</div>
<div class="p1">
sudo mount /dev/vgdisk2/lvdisk2 /mnt/disk2/</div>
<div class="p1">
<br /></div>
<div class="p1">
And it's up!</div>
<div class="p1">
<br /></div>
Erland Lewinhttp://www.blogger.com/profile/17524137346314761155noreply@blogger.com0tag:blogger.com,1999:blog-27853548.post-40726308582473906382014-10-21T22:37:00.001+02:002014-10-21T22:37:26.110+02:00Avoiding Paralells price gouging<a href="http://www.parallels.com/" target="_blank">Paralells</a> makes a virtual machine software for the Mac, called Paralells Desktop. They said I needed to upgrade their product to before upgrading to Mac OS X 10.10 Yosemite (although it seems <a href="http://forum.parallels.com/threads/parallels-desktop-8-and-osx-yosemite-guess-what.326153/" target="_blank">they may have been lying</a>).<br />
<br />
The upgrade price in the US is $50, but if you're located in Europe they charge you $76 for exactly the same thing. Not a respectful way to treat your customers to charge 50% more for a download depending on where you live. (Note - it's not just the VAT).<br />
<br />
So, the way to avoid paying their EU surcharge is to use a free web proxy like <a href="http://www.webproxyusa.com/">www.webproxyusa.com</a>. Go to the site, enter "http://www.parallels.com" in the web address box, and navigate to the download you want. Note: don't enter any credit card details using the web proxy since it circumvents encryption. But enter your e-mail address and pay by Paypal. It's OK to enter an EU address. The price ended up being $59.41 including VAT.<br />
<br />
There you go - save some money!<br />
<br />Erland Lewinhttp://www.blogger.com/profile/17524137346314761155noreply@blogger.com0tag:blogger.com,1999:blog-27853548.post-86706810616965415382014-10-02T20:38:00.001+02:002014-10-02T20:38:26.601+02:00Ubuntu server maintenance<span style="font-family: Verdana, sans-serif;">I'm doing some server maintenance today.</span><br />
<span style="font-family: Verdana, sans-serif;"><br /></span>
<span style="font-family: Verdana, sans-serif;">The main reason being that Ubuntu 13.10 systems are not updated to fix the Shellshock security hole, so I'll try to upgrade my main server to 14.04 or 14.10.</span><br />
<span style="font-family: Verdana, sans-serif;"><br /></span>
<span style="font-family: Verdana, sans-serif;">I had a full /boot partition first which I needed to fix. I had to move two initrd files (initrd.img-3.11.0-15-generic and initrd.img-3.11.0-17-generic) to /tmp temporarily to be able to fix it.</span><br />
<span style="font-family: Verdana, sans-serif;"><br /></span>
<span style="font-family: Verdana, sans-serif;">I then did an "apt-get install -f" to fix some broken package stuff, probably due to the full /boot partition.</span><br />
<span style="font-family: Verdana, sans-serif;"><br /></span>
<span style="font-family: Verdana, sans-serif;">I still got some out of diskspace errors, so I guess I have to move another initrd or two to /tmp:</span><br />
<span style="font-family: Verdana, sans-serif;"><br /></span>
<br />
<blockquote class="tr_bq">
<span style="font-family: Verdana, sans-serif;">run-parts: executing /etc/kernel/postinst.d/initramfs-tools 3.11.0-26-generic /boot/vmlinuz-3.11.0-26-generic<br />update-initramfs: Generating /boot/initrd.img-3.11.0-26-generic<br />gzip: stdout: No space left on device<br />E: mkinitramfs failure cpio 141 gzip 1<br />update-initramfs: failed for /boot/initrd.img-3.11.0-26-generic with 1.<br />run-parts: /etc/kernel/postinst.d/initramfs-tools exited with return code 1<br />Failed to process /etc/kernel/postinst.d at /var/lib/dpkg/info/linux-image-3.11.0-26</span></blockquote>
<span style="font-family: Verdana, sans-serif;">Rerunning "sudo apt-get -f install". It's very slow when doing "running depmod". Success! I now have 23M free on /boot. </span><br />
<span style="font-family: Verdana, sans-serif;"><br /></span>
<span style="font-family: Verdana, sans-serif;">I'll try running apt-get autoremove. I now have 87 MB free on /boot.</span><br />
<span style="font-family: Verdana, sans-serif;"><br /></span>
<span style="font-family: Verdana, sans-serif;">I now do:</span><br />
<br />
<blockquote class="tr_bq">
sudo apt-get purge linux-image-3.11.0-23-generic</blockquote>
<blockquote class="tr_bq">
sudo apt-get purge linux-image-3.11.0-24-generic</blockquote>
<blockquote class="tr_bq">
sudo apt-get purge linux-image-3.11.0-15-generic </blockquote>
The last command removed the running kernel, which I hadn't really planned to do. Oh well. Now I have 155 MB free on /boot.<br />
<br />
Actually, I got a bit worried, so I reinstalled the running kernel (3.11.0-15). 140 MB free.<br />
<br />
Now I'll try again to upgrade to 14.04:<br />
<br />
Hm. I did some kind of resurrect in the previously failed 14.04 installation window. I wonder if the installation restarted properly? I don't dare to interrupt it, so I'll let it run.<br />
<br />
Rebooted after 240 days uptime. It is taking a very long time with the hard disk light on. I hope it is just a forced fsck.<br />
<br />
For some reason the network didn't come up on the first boot, but after the next reboot.<br />
<br />
<blockquote class="tr_bq">
</blockquote>
<br />
<br />Erland Lewinhttp://www.blogger.com/profile/17524137346314761155noreply@blogger.com0tag:blogger.com,1999:blog-27853548.post-28007763743600860882014-08-30T22:33:00.001+02:002014-08-30T22:33:13.289+02:00Adding StartCom CA Cert to JDK 1.7.0 on Mac OS X to access FYB-SE APII tried to access the Bitcoin exchange <a href="https://www.fybse.se/" target="_blank">FYB-SE</a>'s <a href="http://docs.fyb.apiary.io/" target="_blank">API</a> using a Java program under JDK 1.7.0 on Mac OS X 10.9.4. I got an exception:<br />
<blockquote class="tr_bq">
javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target</blockquote>
The reason is that FYB-SE's https SSL security certificate was issued by the Israeli certificate authority <a href="https://www.startssl.com/" target="_blank">StartCom</a>, whose Certificate authority (CA) certificate is not listed in Java's database of trusted certificate authorities.<br />
<br />
My fix was to download Smartcom's CA certificate from <a href="http://www.startssl.com/certs/ca.crt">http://www.startssl.com/certs/ca.crt</a>. Then I did the following:<br />
<blockquote class="tr_bq">
cd /Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/jre/lib/security/<br />
cp cacerts cacerts.orig<br />
sudo keytool -importcert -file ~/certs/ca.crt -keystore cacerts</blockquote>
<div class="p1">
After this, my Java program trusted the certificate, and got stuck at the next error instead ;-)</div>
<div class="p1">
<br /></div>
<span style="color: #444444;"><span style="font-family: Times, Times New Roman, serif; line-height: 12.796875px;">Did you find this useful? Please Flattr me! </span></span><br />
<span style="color: #444444;"><span style="font-family: Times, Times New Roman, serif; line-height: 12.796875px;"><br /></span></span>
<script id="flattrbtn">(function(i){var f,s=document.getElementById(i);f=document.createElement('iframe');f.src='//api.flattr.com/button/view/?uid=erl&url='+encodeURIComponent(document.URL);f.title='Flattr';f.height=62;f.width=55;f.style.borderWidth=0;s.parentNode.insertBefore(f,s);})('flattrbtn');</script>
Erland Lewinhttp://www.blogger.com/profile/17524137346314761155noreply@blogger.com0tag:blogger.com,1999:blog-27853548.post-79443140362005660002014-05-25T23:28:00.000+02:002014-05-25T23:29:43.041+02:00Installing OctoPrint for an original PrintrBot Plus with a TP-Link TL-WN725N Wifi adapterI'm trying to make my Printrbot Plus accessible over WiFi so that I can move it outdoors when printing, to reduce exposure to <a href="http://leafygreenplanet.com/toxic-fumes-abs-pla-3d-printer/" target="_blank">dangerous fumes and nanoparticles</a>.<br />
<div>
<br /></div>
<div>
I formatted the SD-card on my MacBook Pro using the SD Formatter program downloaded from <a href="https://www.sdcard.org/downloads/formatter_4/eula_mac/" target="_blank">here</a> (following instructions <a href="http://elinux.org/RPi_Easy_SD_Card_Setup" target="_blank">here</a>).</div>
<div>
<br />
I used the 2014-01-07 Wheezy Octopi 0.8.0 image from <a href="http://docstech.net/OctoPiMirror/2014-01-07-wheezy-octopi-0.8.0.zip" target="_blank">here</a>.<br />
<br /></div>
<div>
I then unzipped the OctoPi image and copied it to the SD card using:<br />
<br /></div>
<div>
<pre>sudo dd if=2014-01-07-wheezy-octopi-0.8.0.img of=/dev/rdisk3 bs=1m</pre>
</div>
<div>
<br />
I connected my Pi to the wired ethernet network and booted it. After boot I could ssh to octopi.local with username pi and password raspberry.<br />
<br />
I ran sudo raspi-config on first boot to enlarge the initial partition to fill the card, and set my time zone, and rebooted.<br />
<br />
The OctoPi interface is now available at http://octopi.local/<br />
<br />
Next step was to set up my TP-Link TL-WN725N Wifi adapter.<br />
<br />
I used <span style="font-family: Courier New, Courier, monospace;">uname -a</span> to determine my OS version (was 3.10.25+ #622). Using <a href="http://www.raspberrypi.org/forums/viewtopic.php?p=462982#p462982" target="_blank">this</a> list, I determined i had to download this file:<br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">https://dl.dropboxusercontent.com/u/80256631/8188eu-20131219.tar.gz</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: inherit;">I downloaded:</span><br />
<span style="font-family: inherit;"><br /></span>
<br />
<div class="p1">
<pre>wget https://dl.dropboxusercontent.com/u/80256631/8188eu-20131219.tar.gz</pre>
</div>
<div class="p1">
<br /></div>
<div class="p1">
unpacked:</div>
<div class="p1">
<br />
<div class="p1">
<pre>tar -xf 8188eu-20131219.tar.gz</pre>
</div>
<div class="p1">
<br /></div>
</div>
<div class="p1">
installed:</div>
<div class="p1">
<pre>sudo install -p -m 644 8188eu.ko /lib/modules/$(uname -r)/kernel/drivers/net/wireless
sudo insmod /lib/modules/$(uname -r)/kernel/drivers/net/wireless/8188eu.ko
sudo depmod -a
</pre>
</div>
</div>
<br />
<div class="p1">
Checked that the dongle was installed with <span style="font-family: Courier New, Courier, monospace;">iwconfig</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: inherit;">Installed my favorit editor 'emacs' (took a while): </span><span style="font-family: Courier New, Courier, monospace;">sudo apt-get install emacs</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: inherit;">I edited the wpa_supplicant.conf file to add my WiFi password:</span><br />
<br />
<span style="font-family: Courier New, Courier, monospace;">sudo emacs /etc/wpa_supplicant/wpa_supplicant.conf</span><br />
<br />
I added:<br />
<br />
<div class="p1">
<span style="font-family: Courier New, Courier, monospace;">network<span class="s1">={</span></span></div>
<div class="p2">
<span style="font-family: Courier New, Courier, monospace;"><span class="s2">ssid</span><span class="s1">=</span>"<my ssid="">"</my></span></div>
<div class="p2">
<span style="font-family: Courier New, Courier, monospace;"><span class="s2">psk</span><span class="s1">=</span>"<my password="">"</my></span></div>
<div class="p1">
<span style="font-family: Courier New, Courier, monospace;">proto<span class="s1">=RSN</span></span></div>
<div class="p3">
<span style="font-family: Courier New, Courier, monospace;"><span class="s2">key_mgmt</span>=WPA-PSK</span></div>
<div class="p1">
<span style="font-family: Courier New, Courier, monospace;">pairwise<span class="s1">=CCMP</span></span></div>
<div class="p3">
<span style="font-family: Courier New, Courier, monospace;"><span class="s2">group</span>=CCMP</span></div>
<div class="p1">
<span style="font-family: Courier New, Courier, monospace;">auth_alg<span class="s1">=OPEN</span></span></div>
<br />
<div class="p3">
<span style="font-family: Courier New, Courier, monospace;">}</span></div>
<div class="p3">
<br /></div>
<div class="p3">
I took down and and up the interface (not sure if it was neccessary), and could see with ifconfig that wlan0 had an IP address on my wifi network. Note that this was not obvious from the iwconfig results.</div>
<div class="p3">
<br /></div>
<div class="p3">
I have not tried a print yet, but it's looking good.</div>
</div>
Erland Lewinhttp://www.blogger.com/profile/17524137346314761155noreply@blogger.com0tag:blogger.com,1999:blog-27853548.post-65928604813473538152014-02-18T20:38:00.000+01:002014-02-18T20:38:44.394+01:00Getting an Azoteq IQS213 IC touch IC to work with a Nordic Semiconductor nRF51822 microcontrollerI'm trying to get an Azoteq IQS213 touch controller to work with the Nordic Semiconductor NRF51822 processor in my smartwatch project.<br />
<br />
According to the IQS213 documentation, the ready / TO2 line is supposed to go low after startup to signal that the IQS is ready to receive commands from the controller.<br />
<br />
However, this is not happening. The TO2 line is supposed to have a 4.7 kOhm pull-up resistor. Instead I have used the processor's internal 11-16 kOhm resistor as pull-up. Since it's larger than the specified resistor, it should not prevent the line from going low.<br />
<br />
I've verified:<br />
<br />
<ul>
<li>Power (2.8V)</li>
<li>Ground</li>
<li>VReg (1.68 V)</li>
<li>Checked for shorts</li>
<li>Orientation of chip</li>
</ul>
<div>
Still no ready low.</div>
<div>
<br /></div>
<div>
Next step will be to look for anomaly notes from Azoteq, and program an ACK handshake to see if that could work.<br />
<br /></div>
Erland Lewinhttp://www.blogger.com/profile/17524137346314761155noreply@blogger.com5tag:blogger.com,1999:blog-27853548.post-70682364346728624392013-12-09T15:10:00.004+01:002014-02-18T20:40:02.762+01:00Setting up Eclipse under Mac OS X for the Nordic Semiconductor nRF51822I'm <a href="http://www.slideshare.net/ErlandLewin/yet-another-smartwatch" target="_blank">developing a smartwatch</a> with the <a href="https://www.nordicsemi.com/" target="_blank">Nordic Semiconductor</a> <a href="https://www.nordicsemi.com/eng/Products/Bluetooth-R-low-energy/nRF51822" target="_blank">nRF51822</a> IC (a really nice chip!).<br />
<br />
The development environment that comes with<a href="https://www.nordicsemi.com/eng/Products/Bluetooth-R-low-energy/nRF51822-Development-Kit" target="_blank"> Nordic's Development Kit</a> is based on <a href="http://www.keil.com/" target="_blank">Keil</a> (a very expensive commercial IDE), which has a limit of 16K code to use in circuit debugging. Therefore I want to set up a development environment on my Mac using free and open source tools.
Nordic has an application note, <a href="https://www.nordicsemi.com/eng/nordic/download_resource/22748/6/33982841" target="_blank">nAN-29</a>, which describes doing this for Windows.<br />
<br />
I will try <a href="https://launchpad.net/gcc-arm-embedded/+download" target="_blank">installing</a> the <a href="https://launchpad.net/gcc-arm-embedded/" target="_blank">GCC ARM Embedded</a>, because according to <a href="https://devzone.nordicsemi.com/index.php/gcc-toolchain-xcode-porting-your-opinion" target="_blank">this post</a> on the Nordic forums (quote):<br />
<br />
<ol>
<li>a new gcc toolchain based on gcc ARM embedded instead of Codesourcery (As Nordic has chosen to support it and not the other)</li>
<li>Codesourcery on Mac OSX is only a great trouble, as this toolchain lacks of S3 Mentor libs) </li>
<li>Nordic has released new linker scripts for gcc ARM embedded.</li>
</ol>
<div>
I'm going to try to use <a href="https://www.google.se/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&cad=rja&ved=0CDIQFjAA&url=http%3A%2F%2Fwww.eclipse.org%2F&ei=5c6lUuXsN4XV4gSo4YDwBg&usg=AFQjCNFLDQCqoSDxwm1phYDfj2aJnL2dPA&sig2=am1HGj4whqWGlTJDYr9HJA&bvm=bv.57752919,d.bGE" target="_blank">Eclipse</a> rather than XCode, so that the project won't depend on OS X.</div>
<div>
<br /></div>
<div>
I downloaded the "Mac Installation Tarball", which didn't contain an installer. I'm not sure where to put it, so for now I'll put it in my Eclipse workspaces folder.</div>
<div>
<br /></div>
<div>
I created a symbolic link (not an alias) called "gcc-arm-none-eabi" so I wouldn't have to change paths in the project if I update the cross compiler version.</div>
<div>
<br /></div>
<div>
I installed Eclipse according to nAN-29. When I build, it tries and fails to use "C:/Program Files/GNU Tools ARM Embedded/4.7 2013q1/bin/arm-none-eabi-gcc" to compile the project. I need to find where to change this path. nrf51_sdk_v5_0_0_34603/nrf51822/Source/templates/gcc/Makefile.common uses a GNU_INSTALL_ROOT environment variable, I wonder where it is set.</div>
<div>
<br /></div>
<div>
The file nrf51_sdk_v5_0_0_34603/nrf51822/Source/templates/gcc/Makefile.common references Makefile.posix, which does not seem to exist.</div>
<div>
<br /></div>
<div>
GNU_INSTALL_ROOT is set in Makefile.windows, but I don't see why Makefile.windows is used. I'll try to make a Makefile.posix and see if it works better.</div>
<div>
<br /></div>
<div>
I made a Makefile.posix as follows:</div>
<div>
<blockquote class="tr_bq">
GNU_INSTALL_ROOT := /Users/<span class="s1">erlandlewin</span>/Eclipse-workspaces/<span class="s1">gcc</span>-arm-none-<span class="s1">eabi</span>GNU_VERSION := 4.7.4<br />
GNU_PREFIX := arm-none-<span class="s1">eabi</span></blockquote>
I had to edit the Makefile.common as follows:<br />
<blockquote class="tr_bq">
#<span class="s1">ifeq</span> ($(OS),Windows_NT)<br />
#include $(TEMPLATE_PATH)Makefile.windows<br />
#else<br />
include $(TEMPLATE_PATH)Makefile.posix<br />
#<span class="s1">endif</span></blockquote>
I can now build the project in Eclipse and from the command line!<br />
<br />
I will download the J-Link software for Mac from <a href="http://www.segger.com/jlink-software.html" target="_blank">here</a>.<br />
<br />
Followed the instructions in nAN-29 to set up the debugging. In the "GDB command" field of the Debug Configurations dialog, I used the Browse button to find the arm-none-eabi-gdb binary. This way I don't have to set up any paths.<br />
<br />
I start the gdb server using the terminal from the /Application/SEGGER directory, using the following command line:<br />
<br />
<blockquote class="tr_bq">
./JLinkGDBServer -if SWD -device nRF51822</blockquote>
(Thanks to <a href="http://hg.cmason.com/nrf" target="_blank">info from Christopher Mason</a>)<br />
<br />
Woohoo! I can now run debug the ble_app_hrs project from Eclipse via the JLinkGDBServer!<br />
<br />
<br /></div>
Erland Lewinhttp://www.blogger.com/profile/17524137346314761155noreply@blogger.com1tag:blogger.com,1999:blog-27853548.post-15305143793374248252013-08-14T14:36:00.000+02:002013-08-14T15:10:58.480+02:00Making a Raspberry Pi 3G Bridge / HotspotThis post documents making a 3G Internet bridge / hotspot from a Raspberry Pi, a 3G modem, and a separate WiFi access point.<br />
<br />
The purpose was to create an Internet connected WiFi-network at my parents' summer cottage.<br />
<br />
I want to cover a fairly large area of the property and house. I might want several WiFi access points and control their placement and the placement of the 3G modem, therefore I did not want an integrated WiFi hub such as a <a href="http://www.dovado.com/en/products" target="_blank">Dovado 3/4G router</a> (<a href="http://www.kjell.com/Sok?query=dovado" target="_blank">SEK 799</a> / €92 at Kjell & Co.<br />
<br />
I'm using:<br />
<ul>
<li>a <a href="http://www.raspberrypi.org/" target="_blank">Raspberry Pi</a> model B (<a href="http://www.webhallen.com/se-sv/hardvara/167996-raspberry_pi_enkortsdator/" target="_blank">SEK 298</a> / €34 at Webhallen)</li>
<li>the Adafruit <a href="http://learn.adafruit.com/adafruit-raspberry-pi-educational-linux-distro/occidentalis-v0-dot-2" target="_blank">Occidentalis v 0.2</a> distribution (since I'd used it before)</li>
<li>an unlocked Huawei HiLink E353, originally tied to Swedish operator Tre, I think (SEK 179 / €21 <a href="http://www.tradera.com/finding.mvc/itemlisting?header=true&search=e353" target="_blank">at Swedish auction site Tradera</a>)</li>
<li>Connected a WiFi access point I had earlier to the Raspberry Pi.</li>
<li>My plan is to use<a href="http://www.telenor.se/privat/mobilt-bredband/startpaket.html" target="_blank"> Telenor Bredband Kontant</a> (SEK 400 / €46 for 6 months and 10 GB data). I did my tests by borrowing the SIM card from my iPad.</li>
<li>I think I also need a powered USB hub for the 3G modem, will experiment later to see if a more powerful supply for the Raspberry Pi might remove the need for this.</li>
<li>Normally, I used ssh over a network connection to the Raspberry Pi, but when setting up the network bridge, I used a regular monitor (with an HDMI - DVI cable) and a USB keyboard, because the network interfaces must be shut down to set up the bridge.</li>
</ul>
<div>
Installed Occidentalis on the SD card.</div>
<div>
<br /></div>
<div>
Connected RasPi to MacBook with Ethernet cable. Internet sharing from WiFi to Ethernet on MacBook, to give RasPi Internet access. Logged in with <span style="font-family: Courier New, Courier, monospace;">ssh</span> on Raspberry Pi.</div>
<div>
<br /></div>
<div>
Booted the RasPi.</div>
<div>
Did:
<br />
<blockquote class="tr_bq">
<span style="font-family: Courier New, Courier, monospace;">sudo apt-get update</span>
<br />
<span style="font-family: Courier New, Courier, monospace;">sudo apt-get upgrade</span>
</blockquote>
</div>
<div>
(takes a long time)</div>
<div>
<br /></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">usb_modeswitch</span> is required to get 3G modem to work:</div>
<div>
<blockquote class="tr_bq">
<span style="font-family: Courier New, Courier, monospace;"><span style="background-color: white; color: #444444; line-height: 12.800000190734863px;">apt-get install usb-modeswitch</span></span>
</blockquote>
</div>
<div>
<span style="background-color: white; color: #444444; font-family: Times, Times New Roman, serif;">Install UPnP client, will be needed to open ports in the modem:</span><br />
<div style="-webkit-text-stroke-width: 0px; color: black; font-family: Times; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<blockquote class="tr_bq">
<span style="font-family: Courier New, Courier, monospace;"><span style="background-color: white; color: #444444; line-height: 12.800000190734863px;">apt-get </span><span style="background-color: white; color: #444444; line-height: 12.800000190734863px;">install miniupnpc</span></span></blockquote>
</div>
<span style="background-color: white; color: #444444; font-family: Times, Times New Roman, serif; line-height: 12.800000190734863px;">Remove and re-insert dongle?</span></div>
<div>
<br /></div>
<div>
<span style="background-color: white; color: #444444; font-family: Times, Times New Roman, serif; line-height: 12.800000190734863px;">Reboot:</span></div>
<div>
<blockquote class="tr_bq">
<span style="background-color: white; color: #444444; line-height: 12.800000190734863px;"><span style="font-family: Courier New, Courier, monospace;">sudo shutdown -r now</span></span></blockquote>
</div>
<div>
<span style="background-color: white; color: #444444; font-family: Times, Times New Roman, serif;">On startup, stick should be available as eth1, check with ifconfig. If it doesn't it might be that the modem needs to be in a powered USB hub.</span></div>
<div>
<span style="background-color: white; color: #444444; font-family: Times, Times New Roman, serif; line-height: 12.800000190734863px;"><br /></span></div>
<div>
<span style="font-family: Times, Times New Roman, serif;"><span style="background-color: white; color: #444444; line-height: 12.800000190734863px;">edit </span><span style="background-color: white; color: #444444; line-height: 12.796875px;">/etc/network/interfaces</span></span></div>
<div>
<span style="background-color: white; color: #444444; font-family: Times, Times New Roman, serif; line-height: 12.796875px;"><br /></span></div>
<div>
<span style="background-color: white; color: #444444; font-family: Times, Times New Roman, serif; line-height: 12.796875px;">Add:</span></div>
<div>
<blockquote class="tr_bq">
<span style="font-family: Courier New, Courier, monospace;">iface eth1 inet dhcp </span></blockquote>
</div>
<div>
check with:</div>
<div>
<blockquote class="tr_bq">
<span style="font-family: Courier New, Courier, monospace;">sudo ifup eth1</span></blockquote>
</div>
<div>
Great. Try to ssh into RasPi over public internet. How to get public IP?</div>
<div>
<blockquote class="tr_bq">
<span style="background-color: white; color: #222222; font-family: 'Ubuntu Mono', 'Ubuntu Beta Mono A', Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace; line-height: 18px;">wget http://ipecho.net/plain -O - -q ; echo</span></blockquote>
</div>
<div>
<span style="font-family: Times, Times New Roman, serif;"><span style="background-color: white; color: #222222; line-height: 18px;">Got </span><span style="color: #222222;"><span style="line-height: 18px;">90.129.85.242</span></span></span></div>
<div>
<span style="color: #222222;"><span style="font-family: Times, Times New Roman, serif; line-height: 18px;"><br /></span></span></div>
<div>
<span style="color: #222222;"><span style="font-family: Times, Times New Roman, serif; line-height: 18px;">Can't ssh to it (connection refused). After some research found out that in order to open port forwarding on the 3G modem, one must use <a href="http://en.wikipedia.org/wiki/Universal_Plug_and_Play" target="_blank">UPnP</a>.</span></span></div>
<div>
<span style="background-color: white; color: #444444; font-family: arial, sans-serif; font-size: x-small; line-height: 12.796875px;"></span></div>
<br />
<div>
<span style="color: #444444; font-family: arial, sans-serif; font-size: x-small;"><span style="line-height: 12.796875px;">Open port 22 to allow ssh connections from the Internet to the Raspberry Pi.</span></span></div>
<div>
<blockquote class="tr_bq">
<span style="background-color: white; color: #444444; font-family: Courier New, Courier, monospace; line-height: 12.800000190734863px;">// to receive ssh</span></blockquote>
<blockquote class="tr_bq">
<span style="background-color: white; line-height: 12.796875px;"><span style="color: #444444; font-family: Courier New, Courier, monospace;">upnpc -r 22 TCP</span></span></blockquote>
</div>
<div>
<span style="font-family: Times, Times New Roman, serif;">
<span style="background-color: white;"><span style="color: #444444;">Set up bridge (for more information, see <a href="http://www.linuxfoundation.org/collaborate/workgroups/networking/bridge" target="_blank">documentation</a></span></span><span style="color: #444444;">). This entails shutting down both network interfaces, so you will need to be connected to the Pi with keyboard & monitor, or with a third network connection:</span></span><br />
<span style="font-family: Times, Times New Roman, serif;"><span style="color: #444444;"><br /></span></span>
<span style="font-family: Times, Times New Roman, serif;"><span style="color: #444444;">I think I shut down eth0 and eth1 first:</span></span><br />
<blockquote class="tr_bq">
<span style="color: #444444; font-family: Courier New, Courier, monospace;">ifdown eth0</span>
<br />
<span style="font-family: Courier New, Courier, monospace;">ifdown eth1 </span>
</blockquote>
<span style="font-family: Times, Times New Roman, serif;"><span style="color: #444444;">Then set up the bridge:</span></span><br />
<blockquote class="tr_bq">
<span style="background-color: white;"><span style="color: #444444; font-family: Courier New, Courier, monospace;">brctl addbr br0</span></span>
<br />
<span style="background-color: white;"><span style="color: #444444; font-family: Courier New, Courier, monospace;">brctl addif eth0</span></span>
<br />
<span style="background-color: white;"><span style="color: #444444; font-family: Courier New, Courier, monospace;">brctl addif eth1</span></span>
<br />
<span style="color: #444444;"><span style="font-family: Courier New, Courier, monospace;">dhclient br0</span></span></blockquote>
<span style="color: #444444;"><span style="font-family: Times, Times New Roman, serif;">It works! Can access Internet via Dongle from WiFi. </span></span><br />
<span style="color: #444444;"><span style="font-family: Times, Times New Roman, serif;"><br /></span></span>
<span style="color: #444444;"><span style="font-family: Times, Times New Roman, serif;">Modified my WiFi access point to have IP 192.168.1.2</span></span></div>
<br />
<span style="color: #444444; font-family: Times, Times New Roman, serif;">Now set configuration in /etc/network/intefaces:</span><br />
<blockquote class="tr_bq">
<span style="color: #444444; font-family: Courier New, Courier, monospace;">auto lo br0</span>
<br />
<span style="color: #444444; font-family: Courier New, Courier, monospace;"><span style="line-height: 12.796875px;">iface lo inet loopback</span></span>
<br />
<br />
<span style="color: #444444; font-family: Courier New, Courier, monospace;"># Ethernet</span>
<br />
<span style="color: #444444; font-family: Courier New, Courier, monospace;">iface eth0 inet manual</span>
<br />
<br />
<span style="color: #444444; font-family: Courier New, Courier, monospace;"># Huawei 3G dongle</span>
<br />
<span style="color: #444444; font-family: Courier New, Courier, monospace;">iface eth1 inet manual</span>
<br />
<br />
<span style="color: #444444; font-family: Courier New, Courier, monospace;">allow-hotplug eth1</span>
<br />
<br />
<span style="color: #444444; font-family: Courier New, Courier, monospace;"># Bridge</span>
<br />
<span style="color: #444444; font-family: Courier New, Courier, monospace;">iface br0 inet dhcp</span>
<br />
<span style="color: #444444; font-family: Courier New, Courier, monospace;"> bridge_ports eth0 eth1</span>
<br />
<span style="color: #444444; font-family: Courier New, Courier, monospace;"> bridge_fd 0 # no forwarding delay</span>
</blockquote>
<span style="line-height: 12.796875px;"><span style="color: #444444; font-family: Courier New, Courier, monospace; font-size: x-small;"></span></span><br />
<span style="color: #444444; line-height: 12.796875px;"><span style="font-family: Times, Times New Roman, serif;">Configured DynDNS for my DNS provider <a href="http://www.loopia.se/" target="_blank">Loopia</a> according to <a href="http://oskarhane.com/loopia-och-dyndns-med-raspberry-pi/" target="_blank">these</a> instructions. </span></span><br />
<span style="color: #444444; font-family: arial, sans-serif; font-size: x-small;"><span style="line-height: 12.796875px;"><b><br /></b></span></span><span style="color: #444444;"><span style="font-family: Times, Times New Roman, serif; line-height: 12.796875px;">Works very nicely!</span></span><br />
<span style="color: #444444;"><span style="font-family: Times, Times New Roman, serif; line-height: 12.796875px;"><br /></span></span>
<span style="color: #444444;"><span style="font-family: Times, Times New Roman, serif; line-height: 12.796875px;">Did you find this useful? Please Flattr me! </span></span><br />
<span style="color: #444444;"><span style="font-family: Times, Times New Roman, serif; line-height: 12.796875px;"><br /></span></span>
<script id='flattrbtn'>(function(i){var f,s=document.getElementById(i);f=document.createElement('iframe');f.src='//api.flattr.com/button/view/?uid=erl&url='+encodeURIComponent(document.URL);f.title='Flattr';f.height=62;f.width=55;f.style.borderWidth=0;s.parentNode.insertBefore(f,s);})('flattrbtn');</script>
Erland Lewinhttp://www.blogger.com/profile/17524137346314761155noreply@blogger.com2tag:blogger.com,1999:blog-27853548.post-22514639467957953312012-12-27T22:11:00.005+01:002012-12-27T22:12:46.622+01:00PrintrBot Plus Stepper Motor Current <br />
If you have a multimeter, you can set your current limiting potentiometers to the theoretically correct values for the stepper motors by connecting your multimeter ground (black) probe to one of the unused connectors with black wires going from the power supply to the PrintrBoard, and measuring with the multimeter's positive probe at the potentiometer terminals shown in the PrintrBoard image below (red, X, should be 440 mV, yellow (Y and E) should be 400 mV, blue (Z) should be 825 mV:<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjqnPihlgLBfsJ4ukcpoQG6U5DoS_0aLgJUMjtEUqLtvYjkYJFuB-HZCf3__K2erslpfem2GLZaNnxd-VotH-T-0KgyBm_oLnLOjIS72CitJjkzG-GDK7rgjrW04Sa331nZ_0moxQ/s1600/PrintrBoard+Pot+Settings.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="476" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjqnPihlgLBfsJ4ukcpoQG6U5DoS_0aLgJUMjtEUqLtvYjkYJFuB-HZCf3__K2erslpfem2GLZaNnxd-VotH-T-0KgyBm_oLnLOjIS72CitJjkzG-GDK7rgjrW04Sa331nZ_0moxQ/s640/PrintrBoard+Pot+Settings.png" width="640" /></a></div>
Works for me, and the motors run without getting too hot.<br />
<br />
<h3>
The background for those interested</h3>
The Printrbot X, Y and E stepper motors are according to <a href="http://printrbot.com/wp-content/uploads/2012/04/Printrbot-PLUS-BOM-Sheet1-2.pdf">the bill of materials here</a> of type 42BYGH4807. The Z steppers are of type 42BYGH011.<br />
<br />
The X, Y, and E stepper <a href="http://www.kysanelectronics.com/Products/datasheet_display.php?recordID=2979">datasheet</a> specifies their current as 500 mA per phase. <a href="http://www.kysanelectronics.com/Products/datasheet_display.php?recordID=2869">The Z stepper datasheet</a> lists the current as 330 mA.<br />
<br />
The <a href="http://reprap.org/wiki/Printrboard">PrintrBoard</a> uses <a href="http://www.allegromicro.com/Products/Motor-Driver-And-Interface-ICs/Bipolar-Stepper-Motor-Drivers/A4982.aspx">Allegro A4982</a> stepper motor drivers. The <a href="https://www.google.se/url?sa=t&rct=j&q=&esrc=s&source=web&cd=2&cad=rja&ved=0CD0QFjAB&url=http%3A%2F%2Fwww.allegromicro.com%2F~%2FMedia%2FFiles%2FDatasheets%2FA4982-Datasheet.ashx&ei=nKPMUNzZJIaA4gTr7YDwAQ&usg=AFQjCNFWEPUToCWyhdq1peLF6CRQmqZBIw&sig2=2NI-z7dK2FFQMeu3iccaKw&bvm=bv.1355325884,d.bGE">datasheet</a> says that:<br />
<div class="page" title="Page 7">
<div class="layoutArea">
<div class="column">
<blockquote class="tr_bq">
<span style="font-family: 'TimesNewRomanPSMT'; font-size: 10.000000pt;">The maximum value of current limiting is set by the selection of
R</span><span style="font-family: 'TimesNewRomanPSMT'; font-size: 8.000000pt; vertical-align: -3.000000pt;">S</span><span style="font-family: 'TimesNewRomanPS'; font-size: 8.000000pt; font-style: italic; vertical-align: -3.000000pt;">x </span><span style="font-family: 'TimesNewRomanPSMT'; font-size: 10.000000pt;">and the voltage at the VREF pin. The transconductance function is approximated by the maximum value of current limiting,
I</span><span style="font-family: 'TimesNewRomanPSMT'; font-size: 8.000000pt; vertical-align: -3.000000pt;">TripMAX </span><span style="font-family: 'TimesNewRomanPSMT'; font-size: 10.000000pt;">(A), which is set by<br />
</span><span style="font-family: 'TimesNewRomanPSMT'; font-size: 10.000000pt; vertical-align: 3.000000pt;">I</span><span style="font-family: 'TimesNewRomanPSMT'; font-size: 8.000000pt;">TripMAX </span><span style="font-family: 'TimesNewRomanPSMT'; font-size: 10.000000pt; vertical-align: 3.000000pt;">= V</span><span style="font-family: 'TimesNewRomanPSMT'; font-size: 8.000000pt;">REF </span><span style="font-family: 'TimesNewRomanPSMT'; font-size: 10.000000pt; vertical-align: 3.000000pt;">/ ( 8 </span><span style="font-family: 'SymbolMT'; font-size: 16.000000pt; vertical-align: 2.000000pt;">* </span><span style="font-family: 'TimesNewRomanPSMT'; font-size: 10.000000pt; vertical-align: 3.000000pt;">R</span><span style="font-family: 'TimesNewRomanPSMT'; font-size: 8.000000pt;">S</span><span style="font-family: 'TimesNewRomanPSMT'; font-size: 10.000000pt; vertical-align: 3.000000pt;">)<br />
</span><span style="font-family: 'TimesNewRomanPSMT'; font-size: 10.000000pt;">where R</span><span style="font-family: 'TimesNewRomanPSMT'; font-size: 8.000000pt; vertical-align: -3.000000pt;">S </span><span style="font-family: 'TimesNewRomanPSMT'; font-size: 10.000000pt;">is the resistance of the sense resistor (</span><span style="font-family: 'TimesNewRomanPSMT'; font-size: 10.000000pt;">Ω</span><span style="font-family: 'TimesNewRomanPSMT'; font-size: 10.000000pt;">) and V</span><span style="font-family: 'TimesNewRomanPSMT'; font-size: 8.000000pt; vertical-align: -3.000000pt;">REF </span><span style="font-family: 'TimesNewRomanPSMT'; font-size: 10.000000pt;">is<br />
</span><span style="font-family: 'TimesNewRomanPSMT'; font-size: 10.000000pt;">the input voltage on the REF pin (V). </span></blockquote>
</div>
</div>
</div>
The sense resistors (<span style="font-family: TimesNewRomanPSMT; font-size: 10pt; vertical-align: 3pt;">R</span><span style="font-family: TimesNewRomanPSMT; font-size: 8pt;">S</span>) of the PrintrBoard (except for the X stepps for some reason) are 0.1<span style="font-family: TimesNewRomanPSMT; font-size: 13px;">Ω, and </span><span style="font-family: TimesNewRomanPSMT; font-size: 10pt;">V</span><span style="font-family: TimesNewRomanPSMT; font-size: 8pt; vertical-align: -3pt;">REF </span>is set by the pontentiometer. For the X, Y, and E steppers, we want an <span style="font-family: 'TimesNewRomanPSMT'; font-size: 10pt; vertical-align: 3pt;">I</span><span style="font-family: 'TimesNewRomanPSMT'; font-size: 8pt;">TripMAX</span> of 500 mA. Solving the equation gives a <span style="font-family: TimesNewRomanPSMT; font-size: 10pt;">V</span><span style="font-family: TimesNewRomanPSMT; font-size: 8pt; vertical-align: -3pt;">REF</span> of 0.4V for Y and E, and 0.44 V for X<br />
<br />
For the Z steppers, we have two steppers each wanting 330 mA, which gives us an <span style="font-family: 'TimesNewRomanPSMT'; font-size: 10pt; vertical-align: 3pt;">I</span><span style="font-family: 'TimesNewRomanPSMT'; font-size: 8pt;">TripMAX</span> of 660 mA. This gives us a <span style="font-family: TimesNewRomanPSMT; font-size: 10pt;">V</span><span style="font-family: TimesNewRomanPSMT; font-size: 8pt; vertical-align: -3pt;">REF</span> of 0.66 / (0.8) = 825 mV (0.825 V).<br />
<br />
Good luck, have fun!<br />
<br />Erland Lewinhttp://www.blogger.com/profile/17524137346314761155noreply@blogger.com3tag:blogger.com,1999:blog-27853548.post-24605809555824980652011-08-09T17:25:00.000+02:002011-08-09T17:25:00.753+02:00Skandiabanken loginLooking into how Skandiabanken login works.<div><br />
</div><div>Login with certificate link leads to:</div><div><br />
</div><div>http://www.skandiabanken.se/hem/templates/pages/StartPage____1579.aspx?login=1</div><div><br />
</div><div>Leder till Bank ID/Certifikatsval.</div><div><br />
</div><div>Klick på Certifikats-radioknappen verkar leda till:</div><div><br />
</div><div><pre><code>ActiveNextButtonBankIdCert();SetBankIDChoosen(1)</code></pre></div><div><br />
</div><div>"Gå vidare" Button calls BankIDActivate()</div><div><br />
</div><div>Ends up calling:</div><div><br />
</div><div><pre><code>document.authenticateIE.PerformAction('Authenticate');</code></pre></div><div>or</div><div><pre><code>var res = document.authenticateMoz.PerformAction('Authenticate');</code></pre>Depending on if the browser is IE or Mozilla. No action for other browsers.</div><div><br />
</div><div>They are defined like this:</div><div><br />
</div><div><div class="sourceRow" role="presentation"><span class="sourceRowText" role="presentation"> <object id="authenticateIE" classid="CLSID:DD137900-E4D7-4b86-92CC-2E968F846047"></object> </span></div><div class="sourceRow" role="presentation"><a class="sourceLine" role="presentation"> 235</a><span class="sourceRowText" role="presentation"> <object id="authenticateMoz" type="application/x-personal-authentication" length="0" height="0"></object> </span></div><div class="sourceRow" role="presentation"><a class="sourceLine" role="presentation"> 236</a><span class="sourceRowText" role="presentation"></span></div></div><div><br />
</div>Erland Lewinhttp://www.blogger.com/profile/17524137346314761155noreply@blogger.com0tag:blogger.com,1999:blog-27853548.post-8520760182248928532010-09-01T00:21:00.002+02:002011-07-01T16:24:39.628+02:00This blog is now located at http://erlblog.lewin.nuErland Lewinhttp://www.blogger.com/profile/17524137346314761155noreply@blogger.com0tag:blogger.com,1999:blog-27853548.post-58928529651102159292010-02-11T23:27:00.003+01:002010-02-11T23:30:03.503+01:00I just found an existing iPhone app doing exactly what I had planned to do: <a href="http://dopushmail.com/">PushMail</a>. Kudos to its author <a href="http://patarin.info/">Simon Patarin</a>. I'll have to think of something else for my first app.<div><br /></div>Erland Lewinhttp://www.blogger.com/profile/17524137346314761155noreply@blogger.com0tag:blogger.com,1999:blog-27853548.post-90450763960966966452010-02-11T22:05:00.004+01:002010-02-11T22:53:44.148+01:00Working on my first iPhone app project.<div><br /></div><div>Will have a back-end receiving E-mails from exim, putting them in a database.</div><div><br /></div><div>Installed php plugin for parsing MIME e-mails:</div><div><blockquote>sudo pear install Mail_Mime-1.6.0</blockquote><blockquote>sudo pear install Mail_MimeDecode</blockquote></div><div>Hm, according to this:</div><div><a href="http://pear.php.net/package/Mail_mimeDecode/docs/latest/Mail_Mime/Mail_mimeDecode.html"><blockquote>http://pear.php.net/package/Mail_mimeDecode/docs/latest/Mail_Mime/Mail_mimeDecode.html</blockquote></a></div><div>I really want this:</div><div><blockquote><a href="http://pecl.php.net/package/mailparse">PHP mailparse extension</a></blockquote></div><div> Trying:</div><div><blockquote>sudo pecl install mailparse</blockquote><blockquote></blockquote></div><div>Ok, think it worked, added an entry in /etc/php5/conf.d for mailparse.</div><div><br /></div><div>I have a work-in-progress version of mime mail parsing in /home/erl/bin/informMailPiper.php. Run with php -f <recipient>, and send msg to stdinput.</div><div><br /></div>Erland Lewinhttp://www.blogger.com/profile/17524137346314761155noreply@blogger.com0tag:blogger.com,1999:blog-27853548.post-45425884374061572142010-01-18T00:07:00.002+01:002010-01-18T00:09:05.883+01:00Ok, I'm not sure if I built fink in 32 or 64 bit version, or how to check.<div><br /></div><div>Now rebuilding fink in 64-bit only mode.</div><div><br /></div><div>Will probably take a while to redownload all packages. Sigh.</div><div><br /></div>Erland Lewinhttp://www.blogger.com/profile/17524137346314761155noreply@blogger.com0tag:blogger.com,1999:blog-27853548.post-41808792012899664262010-01-17T22:34:00.004+01:002010-01-17T23:41:26.429+01:00<div><blockquote></blockquote><blockquote></blockquote>Continuing with insight3d...</div><div><br /></div><div>...Seems like my opencv was built for i386 architecture (despite being on a 64 bit architecture). </div><div>Manually changed CMakeCache.txt to read:</div><div><br /></div><div>CMAKE_OSX_ARCHITECTURES:STRING=x86_64</div><div><br /></div><div>did make clean and make, we'll see how it goes (takes a long time to compile, IIRC).</div><div><br /></div><div>Didn't work right away.</div><div><br /></div><div>Deleted contents of build dir, and rebuilding, using instructions at <a href="http://opencv.willowgarage.com/wiki/Mac_OS_X_OpenCV_Port">http://opencv.willowgarage.com/wiki/Mac_OS_X_OpenCV_Port</a>, but also changing architecture to x86_64. </div><div><br /></div><div>Getting trouble with carbon, because it is not 64 bits. Trying to disable carbon.</div><div>Uncommented #undef HAVE_CARBON something in cvconfig.h</div><div>That didn't work.</div><div><br /></div><div>Modified the CMakefile for highgui to use gtk+ highgui code also under APPLE.</div><div>rebuilding (in src/highgui/CMakeLists.txt). This time it actually built.</div><div><br /></div><div>Argh. Now I get the following when building insight3d:</div><div><div></div></div><blockquote><div><div>Erland-Lewins-Mac-mini:src erl$ make</div><div>ar rc ../lib/libfeat.a imgfeatures.o utils.o sift.o kdtree.o minpq.o xform.o</div><div>ranlib ../lib/libfeat.a</div><div>gcc -O3 -I../include `pkg-config --cflags opencv` `pkg-config --cflags gtk+-2.0` `pkg-config --cflags gsl` siftfeat.c -o ../bin/siftfeat -L../lib -lfeat `pkg-config --libs opencv` `pkg-config --libs gtk+-2.0` `pkg-config --libs gsl`</div><div>ld: warning: in /sw/lib/libgtk-x11-2.0.dylib, file is not of required architecture</div><div>ld: warning: in /sw/lib/libgdk-x11-2.0.dylib, file is not of required architecture</div><div>ld: warning: in /sw/lib/libatk-1.0.dylib, file is not of required architecture</div><div>ld: warning: in /sw/lib/libgio-2.0.dylib, file is not of required architecture</div><div>ld: warning: in /sw/lib/libpangoft2-1.0.dylib, file is not of required architecture</div><div>ld: warning: in /sw/lib/libgdk_pixbuf-2.0.dylib, file is not of required architecture</div><div>ld: warning: in /sw/lib/libpangocairo-1.0.dylib, file is not of required architecture</div><div>ld: warning: in /sw/lib/libcairo.dylib, file is not of required architecture</div><div>ld: warning: in /sw/lib/libpango-1.0.dylib, file is not of required architecture</div><div>ld: warning: in /sw/lib/libfreetype.dylib, file is not of required architecture</div><div>ld: warning: in /sw/lib/libgobject-2.0.dylib, file is not of required architecture</div><div>ld: warning: in /sw/lib/libgmodule-2.0.dylib, file is not of required architecture</div><div>ld: warning: in /sw/lib/libglib-2.0.dylib, file is not of required architecture</div><div>ld: warning: in /sw/lib/libintl.dylib, file is not of required architecture</div><div>ld: warning: in /sw/lib/libgsl.dylib, file is not of required architecture</div><div>ld: warning: in /sw/lib/libgslcblas.dylib, file is not of required architecture</div><div>Undefined symbols:</div><div> "_gdk_screen_get_default", referenced from:</div><div> _display_big_img in libfeat.a(utils.o)</div><div> "_gdk_screen_get_height", referenced from:</div><div> _display_big_img in libfeat.a(utils.o)</div><div> "_gdk_init", referenced from:</div><div> _display_big_img in libfeat.a(utils.o)</div><div> "_gdk_screen_get_width", referenced from:</div><div> _display_big_img in libfeat.a(utils.o)</div><div>ld: symbol(s) not found</div><div>collect2: ld returned 1 exit status</div><div>make: *** [siftfeat] Error 1</div><div></div></div></blockquote>This mix of 64 bit and 32 bit libraries is really frustrating. I imagine some will be 32 bit, others 64 bit. What is the best strategy? Force everything to be 32 bits? 64 bits?<div><br /></div><div>The night ends in frustration.</div>Erland Lewinhttp://www.blogger.com/profile/17524137346314761155noreply@blogger.com0tag:blogger.com,1999:blog-27853548.post-18675637223133966862010-01-17T16:38:00.003+01:002010-01-17T17:19:31.803+01:00Continuing trying to get insight3d to work.<div><br /></div><div>History: Didn't work well under Ubuntu. Got it to run under Bootcamp Windows XP, but got some crash there too. </div><div><br /></div><div>Plan: Will try to build on mac, which is my main machine.</div><div><br /></div><div>Compiled opencv on the mac. Copied the opencv.pc (pkg-config file) manually to /sw/share/pkgconfig.</div><div><br /></div><div>Compilation on insight3d started.</div><div><br /></div><div>Stopped in:</div><div><div></div><blockquote><div>g++ -O3 -c `pkg-config --cflags opencv libxml-2.0 sdl gtk+-2.0` -I./ann_1.1.1/include/ cv_extensions.cpp</div><div>cv_extensions.cpp: In function ‘void cvComputeRQDecomposition(CvMat*, CvMat*, CvMat*, CvMat*, CvMat*, CvMat*, CvPoint3D64f*)’:</div><div>cv_extensions.cpp:18: error: ‘__BEGIN__’ was not declared in this scope</div><div>cv_extensions.cpp:197: error: ‘__END__’ was not declared in this scope</div><div>cv_extensions.cpp:22: error: label ‘exit’ used but not defined</div><div></div></blockquote><div>#include <cxerror.h> in cv_extensions.cpp.</div><div>Changed __BEGIN__ to __CV_BEGIN__ and __END__ to __CV_END__</div><div>Lots of warnings about printf formats being wrong, ignoring those.</div><div><br /></div><div>Next stopped on missing gsl lib.</div><div>Trying "sudo fink install gsl"</div><div>Added ,0 parameter last in call to cvSaveImage in sift/src/siftfeat.c</div><div><br /></div><div>Getting errors like this:</div><div><br /></div><div><div></div></div><blockquote><div><div>Erland-Lewins-Mac-mini:sift erl$ make</div><div>make -C ./src siftfeat</div><div>ar rc ../lib/libfeat.a imgfeatures.o utils.o sift.o kdtree.o minpq.o xform.o</div><div>ranlib ../lib/libfeat.a</div><div>ranlib: warning for library: ../lib/libfeat.a the table of contents is empty (no object file members in the library define global symbols)</div><div>gcc -O3 -I../include `pkg-config --cflags opencv` `pkg-config --cflags gtk+-2.0` `pkg-config --cflags gsl` siftfeat.c -o ../bin/siftfeat -L../lib -lfeat `pkg-config --libs opencv` `pkg-config --libs gtk+-2.0` `pkg-config --libs gsl`</div><div>ld: warning: in ../lib/libfeat.a, file is not of required architecture</div><div>ld: warning: in /usr/local/lib/libcxcore.dylib, file is not of required architecture</div><div>ld: warning: in /usr/local/lib/libcv.dylib, file is not of required architecture</div><div>ld: warning: in /usr/local/lib/libhighgui.dylib, file is not of required architecture</div></div><div></div></blockquote><div>sift/src/imgfeatures.c: 298, change format for line number from %s to %d</div><div><div>sift/src/imgfeatures.c: 369, added -1, -1 to parameters to cvEigenVV</div><div><br /></div><div>Now getting the "file is not of required architecture problems". Will continue to investigate later</div><div><br /></div></div><div><br /></div><div><br /></div></div>Erland Lewinhttp://www.blogger.com/profile/17524137346314761155noreply@blogger.com2tag:blogger.com,1999:blog-27853548.post-85136626225220987882010-01-15T20:47:00.002+01:002010-01-16T22:47:37.899+01:00Found <a href="http://insight3d.sourceforge.net/">insight3D</a>, a cool program to make 3D models out of photos of objects from different angles.<div><br /></div><div>Will try to compile for Ubuntu Linux 9.10, doesn't seem to be immediately available for MacOS X.</div><div><br /></div><div>Downloaded OpenCV from:</div><div><br /></div><div>http://dfn.dl.sourceforge.net/project/opencvlibrary/opencv-unix/2.0/OpenCV-2.0.0.tar.bz2</div><div><br /></div><div>Did: apt-get install libgtk2.0-0</div><div>Did: sudo apt-get install libgtk2.0-dev</div><div>Did: sudo apt-get install gsl-bin</div><div><div>Did: sudo apt-get install libgsl0-dev</div><div><br /></div></div><div>Trying to configure with:</div><div><br /></div><div>./configure --prefix=/usr/local</div><div><br /></div><div>Compiling insight3D with make.</div><div><br /></div><div>Failed to run insight3d over X11 on my mac.</div><div><br /></div><div>Will try to compile on my mac.</div><div><br /></div><div>Managed to compile opencv with instructions <a href="http://www.christophseibert.de/weblog/en/it/computer-vision/tools/">here</a> (after installing cmake with fink).</div><div><br /></div><div>Managed to compile and run isight3D under Ubuntu on my laptop, but it crashes with an assertion on the example photos. Will try running it under Windows XP on bootcamp on the Mac.</div><div><br /></div><div><br /></div>Erland Lewinhttp://www.blogger.com/profile/17524137346314761155noreply@blogger.com0tag:blogger.com,1999:blog-27853548.post-1558478200405922212009-11-06T20:49:00.003+01:002009-11-06T22:57:48.251+01:00Plan: make my server into a good file server for Macs with Time Machine support.<br /><br />Found this page: <a href="http://www.kremalicious.com/2008/06/ubuntu-as-mac-file-server-and-time-machine-volume/">Howto: Make Ubuntu a Perfect Mac File Server and Time Machine Volume</a><br /><br />Did:<br /><span style="font-size:85%;"><span style="font-family: courier new;"></span></span><blockquote><span style="font-size:85%;"><span style="font-family: courier new;">sudo apt-get build-dep netatalk</span></span><br /><code style="width: 795px; display: block;">sudo apt-get install cracklib2-dev fakeroot libssl-dev<br /></code><code style="width: 496px; display: block;">sudo apt-get source netatalk<br />cd netatalk-2*<br /></code><code style="width: 496px; display: block;">sudo DEB_BUILD_OPTIONS=ssl dpkg-buildpackage -rfakeroot<br /></code><code style="width: 496px; display: block;">sudo dpkg -i ~/netatalk_2*.deb</code></blockquote><code style="width: 496px; display: block;"></code><span style="font-size:100%;">Hm, got errors at this point. Hope it won't be a problem.<br /><br />Did:</span><br /><code style="width: 496px; display: block;"></code><blockquote>echo "netatalk hold" | sudo dpkg --set-selections<br /></blockquote><span style="font-size:100%;"><span style="font-family: georgia;">Followed the instructions modifying settings file. Left the printer service and old appletalk in, since it seems like the printer daemon was dependent on the old appletalk stuff.</span><br /><span style="font-family: georgia;">Added -ipaddr to the /etc/netatalk/afpd.conf to make sure the intranet IP address was chosen.</span><br /><br /></span><span style="font-family: georgia;font-size:130%;" ><span style="font-size:100%;">To open up the firewall, did:</span><br /></span><blockquote>sudo ufw allow proto tcp from any to 172.16.1.21 port 548<br />sudo ufw allow proto udp from any to 172.16.1.21 port 5353</blockquote><span style="font-size:100%;"><span style="font-family: georgia;">After a bit of 'fippling' by following the article's instructions for creating a disk image etc, it works!</span><br /></span>Erland Lewinhttp://www.blogger.com/profile/17524137346314761155noreply@blogger.com0tag:blogger.com,1999:blog-27853548.post-67511510612462808192009-11-04T21:42:00.003+01:002009-11-06T00:08:27.957+01:00Debugging why my squeezeboxserver (version 7.4 under Ubuntu 9.04) can't find my SliMP3 player.<br /><br />The Squeezeboxserver perl stuff seems to be installed under /usr/share/perl/Slim.<br /><br />I can see with tcpdump that the player is broadcasting, but the perl squeezeboxserver process doesn't seem to be listening.<br /><br />Debugging the server with:<br /><blockquote>perl -d -w /usr/sbin/squeezeboxserver --prefsdir /var/lib/squeezeboxserver/prefs --logdir /var/log/squeezeboxserver/ --cachedir /var/lib/squeezeboxserver/cache --charset utf8 --playeraddr 172.16.1.21 --logfile debuglog --logging debug<br /></blockquote>which invokes the perl debugger.<br /><br />Didn't get anywhere. I suspect it may have to do with the two network interfaces on cumulus. Apparently UDP broadcasts only go out on one interface, which is arbitrary unless the server binds to a particular address. That's why I tried the playeraddr command above, which actually helped move the broadcast to the right interface, but that wasn't enough.<br /><br />The key thing seems to be that although the server is listening to UDP on port 3483 (according to netstat -l), the process isn't receiving or selecting on that socket.<br /><br />Reinstalling didn't help. Disabled most plugins.<br /><br />Did a lot of debugging, and playing around with the firewall. After removing the -playeraddr argument to squeezeboxserver, it found the SliMP3. May have been a firewall issue with broadcast addresses?<br /><br />Problems which have a combination of causes can be so hard to track down...Erland Lewinhttp://www.blogger.com/profile/17524137346314761155noreply@blogger.com0