Friday, July 31, 2015

Experimenting with PLA

I'm experimenting with PLA filament on my Printrbot Classic 3D printer. Slicing with Slic3r 1.2.9. Printing with Octoprint.

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.

Bed measured temp is around 71. Hotend temp set to 215.

Set first layer speed changed from 25% to 15 mm/s. Retry.

I think head was too far from bed. Changed G92 Z-1.6 to G92 Z-1.5 in printer init script.

filament is coming out of printhead unevenly - in globs.

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.

First layer still not sticking properly. Still uneven flow.

Lower printhead even more, to Z-1.35. Globbing could be because not sticking properly?

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.

Changed to G92 Z-1.1. Still looks the same.

Now tried adjusting Z-stop screw instead of G92. Removing G92 command. Retry.

That seems to have done it!

Continued experiments:

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.

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).

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.

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.

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.

Worked well. Slower layer times appear to be an alternative to having a fan.

Continued experiments 2015-08-02

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.

Extruder skipped. Raised extruder temp to 215. Head was too far from printbed. Needed to back off on Z-screw 1.5 turns.

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.

Printout turned out fairly well. A bit of unevenness, but OK for a structural part that doesn't have to be pretty.

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.

Tuesday, July 28, 2015

Raspberry Pi troubles solved

After 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.

Turned out that the firmware needed for it has been removed from the Raspberry Pi kernel, so the fix as presented here was to do:

sudo wget https://github.com/lwfinger/rtl8188eu/raw/c83976d1dfb4793893158461430261562b3a5bf0/rtl8188eufw.bin  -O /lib/firmware/rtlwifi/rtl8188eufw.bin
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.



Sunday, January 25, 2015

Using an Arduino 32u4 as a Visual Pinball controller

I'm building a Visual Pinball cabinet, and I'm planning to use an Arduino Compatible board (a Pololu A-Star 32U4 Micro) 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.

I may later try to use the Arduino as an output device as well, to control a lit button, and some solenoids.

I've found the following sites with information:
So, all information seems to be available.

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.

I forked the Arduino stable (1.0.6) distribution on GitHub here.

I've pushed my untested changes. To be continued.

Sunday, October 26, 2014

Adding a new disk to an LVM Ubuntu system

Today I'm adding another disk to my main Linux server.

I used cgdisk to write a partition table. I set the partition type to 8e00 for LVM (Logical Volume Manager?)

sudo pvcreate /dev/sdb1

$ sudo lvcreate --extents 100%FREE -n lvdisk2 vgdisk2 
  Logical volume "lvdisk2" created

$ sudo vgcreate vgdisk2 /dev/sdb1

  Volume group "vgdisk2" successfully created

sudo mkdir /mnt/disk2
sudo mount /dev/vgdisk2/lvdisk2 /mnt/disk2/

And it's up!

Tuesday, October 21, 2014

Avoiding Paralells price gouging

Paralells 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 they may have been lying).

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).

So, the way to avoid paying their EU surcharge is to use a free web proxy like www.webproxyusa.com. 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.

There you go - save some money!

Thursday, October 02, 2014

Ubuntu server maintenance

I'm doing some server maintenance today.

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.

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.

I then did an "apt-get install -f" to fix some broken package stuff, probably due to the full /boot partition.

I still got some out of diskspace errors, so I guess I have to move another initrd or two to /tmp:


run-parts: executing /etc/kernel/postinst.d/initramfs-tools 3.11.0-26-generic /boot/vmlinuz-3.11.0-26-generic
update-initramfs: Generating /boot/initrd.img-3.11.0-26-generic
gzip: stdout: No space left on device
E: mkinitramfs failure cpio 141 gzip 1
update-initramfs: failed for /boot/initrd.img-3.11.0-26-generic with 1.
run-parts: /etc/kernel/postinst.d/initramfs-tools exited with return code 1
Failed to process /etc/kernel/postinst.d at /var/lib/dpkg/info/linux-image-3.11.0-26
Rerunning "sudo apt-get -f install". It's very slow when doing "running depmod". Success! I now have 23M free on /boot. 

I'll try running apt-get autoremove. I now have 87 MB free on /boot.

I now do:

sudo apt-get purge linux-image-3.11.0-23-generic
sudo apt-get purge linux-image-3.11.0-24-generic
sudo apt-get purge linux-image-3.11.0-15-generic 
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.

Actually, I got a bit worried, so I reinstalled the running kernel (3.11.0-15). 140 MB free.

Now I'll try again to upgrade to 14.04:

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.

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.

For some reason the network didn't come up on the first boot, but after the next reboot.



Saturday, August 30, 2014

Adding StartCom CA Cert to JDK 1.7.0 on Mac OS X to access FYB-SE API

I tried to access the Bitcoin exchange FYB-SE's API using a Java program under JDK 1.7.0 on Mac OS X 10.9.4. I got an exception:
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
The reason is that FYB-SE's https SSL security certificate was issued by the Israeli certificate authority StartCom, whose Certificate authority (CA) certificate is not listed in Java's database of trusted certificate authorities.

My fix was to download Smartcom's CA certificate from http://www.startssl.com/certs/ca.crt. Then I did the following:
cd /Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/jre/lib/security/
cp cacerts cacerts.orig
sudo keytool -importcert -file ~/certs/ca.crt -keystore cacerts
After this, my Java program trusted the certificate, and got stuck at the next error instead ;-)

Did you find this useful? Please Flattr me! 

Sunday, May 25, 2014

Installing OctoPrint for an original PrintrBot Plus with a TP-Link TL-WN725N Wifi adapter

I'm trying to make my Printrbot Plus accessible over WiFi so that I can move it outdoors when printing, to reduce exposure to dangerous fumes and nanoparticles.

I formatted the SD-card on my MacBook Pro using the SD Formatter program downloaded from here (following instructions here).

I used the 2014-01-07 Wheezy Octopi 0.8.0 image from here.

I then unzipped the OctoPi image and copied it to the SD card using:

sudo dd if=2014-01-07-wheezy-octopi-0.8.0.img of=/dev/rdisk3 bs=1m

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.

I ran sudo raspi-config on first boot to enlarge the initial partition to fill the card, and set my time zone, and rebooted.

The OctoPi interface is now available at http://octopi.local/

Next step was to set up my TP-Link TL-WN725N Wifi adapter.

I used uname -a to determine my OS version (was 3.10.25+ #622). Using this list, I determined i had to download this file:

https://dl.dropboxusercontent.com/u/80256631/8188eu-20131219.tar.gz

I downloaded:


wget https://dl.dropboxusercontent.com/u/80256631/8188eu-20131219.tar.gz

unpacked:

tar -xf 8188eu-20131219.tar.gz

installed:
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

Checked that the dongle was installed with iwconfig

Installed my favorit editor 'emacs' (took a while): sudo apt-get install emacs

I edited the wpa_supplicant.conf file to add my WiFi password:

sudo emacs /etc/wpa_supplicant/wpa_supplicant.conf

I added:

network={
ssid=""
psk=""
proto=RSN
key_mgmt=WPA-PSK
pairwise=CCMP
group=CCMP
auth_alg=OPEN

}

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.

I have not tried a print yet, but it's looking good.

Tuesday, February 18, 2014

Getting an Azoteq IQS213 IC touch IC to work with a Nordic Semiconductor nRF51822 microcontroller

I'm trying to get an Azoteq IQS213 touch controller to work with the Nordic Semiconductor NRF51822 processor in my smartwatch project.

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.

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.

I've verified:

  • Power (2.8V)
  • Ground
  • VReg (1.68 V)
  • Checked for shorts
  • Orientation of chip
Still no ready low.

Next step will be to look for anomaly notes from Azoteq, and program an ACK handshake to see if that could work.

Monday, December 09, 2013

Setting up Eclipse under Mac OS X for the Nordic Semiconductor nRF51822

I'm developing a smartwatch with the Nordic Semiconductor nRF51822 IC (a really nice chip!).

The development environment that comes with Nordic's Development Kit is based on Keil (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, nAN-29, which describes doing this for Windows.

I will try installing the GCC ARM Embedded, because according to this post on the Nordic forums (quote):

  1. a new gcc toolchain based on gcc ARM embedded instead of Codesourcery (As Nordic has chosen to support it and not the other)
  2. Codesourcery on Mac OSX is only a great trouble, as this toolchain lacks of S3 Mentor libs) 
  3. Nordic has released new linker scripts for gcc ARM embedded.
I'm going to try to use Eclipse rather than XCode, so that the project won't depend on OS X.

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.

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.

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.

The file nrf51_sdk_v5_0_0_34603/nrf51822/Source/templates/gcc/Makefile.common references Makefile.posix, which does not seem to exist.

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.

I made a Makefile.posix as follows:
GNU_INSTALL_ROOT := /Users/erlandlewin/Eclipse-workspaces/gcc-arm-none-eabiGNU_VERSION := 4.7.4
GNU_PREFIX := arm-none-eabi
 I had to edit the Makefile.common as follows:
#ifeq ($(OS),Windows_NT)
#include $(TEMPLATE_PATH)Makefile.windows
#else
include $(TEMPLATE_PATH)Makefile.posix
#endif
I can now build the project in Eclipse and from the command line!

I will download the J-Link software for Mac from here.

 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.

I start the gdb server using the terminal from the /Application/SEGGER directory, using the following command line:

./JLinkGDBServer -if SWD -device nRF51822
(Thanks to info from Christopher Mason)

Woohoo! I can now run debug the ble_app_hrs project from Eclipse via the JLinkGDBServer!


Wednesday, August 14, 2013

Making a Raspberry Pi 3G Bridge / Hotspot

This post documents making a 3G Internet bridge / hotspot from a Raspberry Pi, a 3G modem, and a separate WiFi access point.

The purpose was to create an Internet connected WiFi-network at my parents' summer cottage.

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 Dovado 3/4G router (SEK 799 / €92 at Kjell & Co.

I'm using:
  • a Raspberry Pi model B (SEK 298 / €34 at Webhallen)
  • the Adafruit Occidentalis v 0.2 distribution (since I'd used it before)
  • an unlocked Huawei HiLink E353, originally tied to Swedish operator Tre, I think (SEK 179 / €21 at Swedish auction site Tradera)
  • Connected a WiFi access point I had earlier to the Raspberry Pi.
  • My plan is to use Telenor Bredband Kontant (SEK 400 / €46 for 6 months and 10 GB data). I did my tests by borrowing the SIM card from my iPad.
  • 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.
  • 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.
Installed Occidentalis on the SD card.

Connected RasPi to MacBook with Ethernet cable. Internet sharing from WiFi to Ethernet on MacBook, to give RasPi Internet access. Logged in with ssh on Raspberry Pi.

Booted the RasPi.
Did:
sudo apt-get update
sudo apt-get upgrade
(takes a long time)

usb_modeswitch is required to get 3G modem to work:
apt-get install usb-modeswitch
Install UPnP client, will be needed to open ports in the modem:
apt-get install miniupnpc
Remove and re-insert dongle?

Reboot:
sudo shutdown -r now
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.

edit /etc/network/interfaces

Add:
iface eth1 inet dhcp 
check with:
sudo ifup eth1
Great. Try to ssh into RasPi over public internet. How to get public IP?
wget http://ipecho.net/plain -O - -q ; echo
Got 90.129.85.242

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 UPnP.

Open port 22 to allow ssh connections from the Internet to the Raspberry Pi.
// to receive ssh
upnpc -r 22 TCP
Set up bridge (for more information, see documentation). 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:

I think I shut down eth0 and eth1 first:
ifdown eth0
ifdown eth1 
Then set up the bridge:
brctl addbr br0
brctl addif eth0
brctl addif eth1
dhclient br0
It works! Can access Internet via Dongle from WiFi. 

Modified my WiFi access point to have IP 192.168.1.2

Now set configuration in /etc/network/intefaces:
auto lo br0
iface lo inet loopback 

# Ethernet
iface eth0 inet manual

# Huawei 3G dongle
iface eth1 inet manual

allow-hotplug eth1

# Bridge
iface br0 inet dhcp
  bridge_ports eth0 eth1
  bridge_fd 0 # no forwarding delay

Configured DynDNS for my DNS provider Loopia according to these instructions. 

Works very nicely!

Did you find this useful? Please Flattr me! 

Thursday, December 27, 2012

PrintrBot Plus Stepper Motor Current


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:
Works for me, and the motors run without getting too hot.

The background for those interested

The Printrbot X, Y and E stepper motors are according to the bill of materials here of type 42BYGH4807. The Z steppers are of type 42BYGH011.

The X, Y, and E stepper datasheet specifies their current as 500 mA per phase. The Z stepper datasheet lists the current as 330 mA.

The PrintrBoard uses Allegro A4982 stepper motor drivers. The datasheet says that:
The maximum value of current limiting is set by the selection of RSx and the voltage at the VREF pin. The transconductance function is approximated by the maximum value of current limiting, ITripMAX (A), which is set by
ITripMAX = VREF / ( 8 * RS)
where RS is the resistance of the sense resistor (Ω) and VREF is
the input voltage on the REF pin (V). 
The sense resistors (RS) of the PrintrBoard (except for the X stepps for some reason) are 0.1Ω, and VREF is set by the pontentiometer. For the X, Y, and E steppers, we want an ITripMAX of 500 mA. Solving the equation gives a VREF of 0.4V for Y and E, and 0.44 V for X

For the Z steppers, we have two steppers each wanting 330 mA, which gives us an  ITripMAX of 660 mA. This gives us a  VREF of 0.66 / (0.8) = 825 mV (0.825 V).

Good luck, have fun!

Tuesday, August 09, 2011

Skandiabanken login

Looking into how Skandiabanken login works.

Login with certificate link leads to:

http://www.skandiabanken.se/hem/templates/pages/StartPage____1579.aspx?login=1

Leder till Bank ID/Certifikatsval.

Klick på Certifikats-radioknappen verkar leda till:

ActiveNextButtonBankIdCert();SetBankIDChoosen(1)

"GÃ¥ vidare" Button calls BankIDActivate()

Ends up calling:

document.authenticateIE.PerformAction('Authenticate');
or
var res = document.authenticateMoz.PerformAction('Authenticate');
Depending on if the browser is IE or Mozilla. No action for other browsers.

They are defined like this:


Wednesday, September 01, 2010

Thursday, February 11, 2010

I just found an existing iPhone app doing exactly what I had planned to do: PushMail. Kudos to its author Simon Patarin. I'll have to think of something else for my first app.

Working on my first iPhone app project.

Will have a back-end receiving E-mails from exim, putting them in a database.

Installed php plugin for parsing MIME e-mails:
sudo pear install Mail_Mime-1.6.0
sudo pear install Mail_MimeDecode
Hm, according to this:
I really want this:
Trying:
sudo pecl install mailparse
Ok, think it worked, added an entry in /etc/php5/conf.d for mailparse.

I have a work-in-progress version of mime mail parsing in /home/erl/bin/informMailPiper.php. Run with php -f , and send msg to stdinput.

Monday, January 18, 2010

Ok, I'm not sure if I built fink in 32 or 64 bit version, or how to check.

Now rebuilding fink in 64-bit only mode.

Will probably take a while to redownload all packages. Sigh.

Sunday, January 17, 2010

Continuing with insight3d...

...Seems like my opencv was built for i386 architecture (despite being on a 64 bit architecture).
Manually changed CMakeCache.txt to read:

CMAKE_OSX_ARCHITECTURES:STRING=x86_64

did make clean and make, we'll see how it goes (takes a long time to compile, IIRC).

Didn't work right away.

Deleted contents of build dir, and rebuilding, using instructions at http://opencv.willowgarage.com/wiki/Mac_OS_X_OpenCV_Port, but also changing architecture to x86_64.

Getting trouble with carbon, because it is not 64 bits. Trying to disable carbon.
Uncommented #undef HAVE_CARBON something in cvconfig.h
That didn't work.

Modified the CMakefile for highgui to use gtk+ highgui code also under APPLE.
rebuilding (in src/highgui/CMakeLists.txt). This time it actually built.

Argh. Now I get the following when building insight3d:
Erland-Lewins-Mac-mini:src erl$ make
ar rc ../lib/libfeat.a imgfeatures.o utils.o sift.o kdtree.o minpq.o xform.o
ranlib ../lib/libfeat.a
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`
ld: warning: in /sw/lib/libgtk-x11-2.0.dylib, file is not of required architecture
ld: warning: in /sw/lib/libgdk-x11-2.0.dylib, file is not of required architecture
ld: warning: in /sw/lib/libatk-1.0.dylib, file is not of required architecture
ld: warning: in /sw/lib/libgio-2.0.dylib, file is not of required architecture
ld: warning: in /sw/lib/libpangoft2-1.0.dylib, file is not of required architecture
ld: warning: in /sw/lib/libgdk_pixbuf-2.0.dylib, file is not of required architecture
ld: warning: in /sw/lib/libpangocairo-1.0.dylib, file is not of required architecture
ld: warning: in /sw/lib/libcairo.dylib, file is not of required architecture
ld: warning: in /sw/lib/libpango-1.0.dylib, file is not of required architecture
ld: warning: in /sw/lib/libfreetype.dylib, file is not of required architecture
ld: warning: in /sw/lib/libgobject-2.0.dylib, file is not of required architecture
ld: warning: in /sw/lib/libgmodule-2.0.dylib, file is not of required architecture
ld: warning: in /sw/lib/libglib-2.0.dylib, file is not of required architecture
ld: warning: in /sw/lib/libintl.dylib, file is not of required architecture
ld: warning: in /sw/lib/libgsl.dylib, file is not of required architecture
ld: warning: in /sw/lib/libgslcblas.dylib, file is not of required architecture
Undefined symbols:
"_gdk_screen_get_default", referenced from:
_display_big_img in libfeat.a(utils.o)
"_gdk_screen_get_height", referenced from:
_display_big_img in libfeat.a(utils.o)
"_gdk_init", referenced from:
_display_big_img in libfeat.a(utils.o)
"_gdk_screen_get_width", referenced from:
_display_big_img in libfeat.a(utils.o)
ld: symbol(s) not found
collect2: ld returned 1 exit status
make: *** [siftfeat] Error 1
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?

The night ends in frustration.
Continuing trying to get insight3d to work.

History: Didn't work well under Ubuntu. Got it to run under Bootcamp Windows XP, but got some crash there too.

Plan: Will try to build on mac, which is my main machine.

Compiled opencv on the mac. Copied the opencv.pc (pkg-config file) manually to /sw/share/pkgconfig.

Compilation on insight3d started.

Stopped in:
g++ -O3 -c `pkg-config --cflags opencv libxml-2.0 sdl gtk+-2.0` -I./ann_1.1.1/include/ cv_extensions.cpp
cv_extensions.cpp: In function ‘void cvComputeRQDecomposition(CvMat*, CvMat*, CvMat*, CvMat*, CvMat*, CvMat*, CvPoint3D64f*)’:
cv_extensions.cpp:18: error: ‘__BEGIN__’ was not declared in this scope
cv_extensions.cpp:197: error: ‘__END__’ was not declared in this scope
cv_extensions.cpp:22: error: label ‘exit’ used but not defined
#include in cv_extensions.cpp.
Changed __BEGIN__ to __CV_BEGIN__ and __END__ to __CV_END__
Lots of warnings about printf formats being wrong, ignoring those.

Next stopped on missing gsl lib.
Trying "sudo fink install gsl"
Added ,0 parameter last in call to cvSaveImage in sift/src/siftfeat.c

Getting errors like this:

Erland-Lewins-Mac-mini:sift erl$ make
make -C ./src siftfeat
ar rc ../lib/libfeat.a imgfeatures.o utils.o sift.o kdtree.o minpq.o xform.o
ranlib ../lib/libfeat.a
ranlib: warning for library: ../lib/libfeat.a the table of contents is empty (no object file members in the library define global symbols)
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`
ld: warning: in ../lib/libfeat.a, file is not of required architecture
ld: warning: in /usr/local/lib/libcxcore.dylib, file is not of required architecture
ld: warning: in /usr/local/lib/libcv.dylib, file is not of required architecture
ld: warning: in /usr/local/lib/libhighgui.dylib, file is not of required architecture
sift/src/imgfeatures.c: 298, change format for line number from %s to %d
sift/src/imgfeatures.c: 369, added -1, -1 to parameters to cvEigenVV

Now getting the "file is not of required architecture problems". Will continue to investigate later



Friday, January 15, 2010

Found insight3D, a cool program to make 3D models out of photos of objects from different angles.

Will try to compile for Ubuntu Linux 9.10, doesn't seem to be immediately available for MacOS X.

Downloaded OpenCV from:

http://dfn.dl.sourceforge.net/project/opencvlibrary/opencv-unix/2.0/OpenCV-2.0.0.tar.bz2

Did: apt-get install libgtk2.0-0
Did: sudo apt-get install libgtk2.0-dev
Did: sudo apt-get install gsl-bin
Did: sudo apt-get install libgsl0-dev

Trying to configure with:

./configure --prefix=/usr/local

Compiling insight3D with make.

Failed to run insight3d over X11 on my mac.

Will try to compile on my mac.

Managed to compile opencv with instructions here (after installing cmake with fink).

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.