Mac OS X

From Openmoko

Revision as of 18:29, 20 December 2007 by Kousue (Talk | contribs)

Jump to: navigation, search

Welcome to the OpenMoko page devoted to MacOS X users!

Here you can find notes of using Neo1973 (and maybe other OM devices) with Mac.

Contents

Flashing to your device

To operate the Phase 1 devices, you need to flash a root file system first.

NOTE: you need an Intel Mac to run dfu-util since it is currently broken on big-endian machines (PowerPC).

Here is a detailed instruction:

  1. If you don't have Mac OS X 10.4.10 (Apple already ships a more stable CDC ECM driver, and DFU through libusb doesn't need a driver at all):
    1. download the latest version of AJZaurusUSB from http://www.dsitri.de/wiki.php?page=AJZaurusUSB
    2. install
    3. run 'sudo kextload /System/Library/Extensions/AJZaurusUSB.kext' from Terminal (or reboot your Mac as described - but you do not need to configure AJZaurusUSB it before flashing the OpenMoko)
  2. download the latest version of OpenMoko Flasher from http://www.dsitri.de/wiki.php?page=OpenMoko%20Flasher
  3. [V1.0 only: create a new Folder at "~/Library/Caches/OpenMoko Flasher"]
  4. press the Refresh button (which loads the list of packages on the server)
  5. select and load the rootfs (takes some minutes for approx. 40 MByte)
  6. [V1.0 and V1.1 only: open the Console application and show the console.log]
  7. Now, on your OpenMoko, hold the AUX button while pressing the Power button for 5 seconds
  8. the BOOT menu should appear
  9. connect the USB cable
  10. Press the Flash button
  11. the BOOT menu screen on the OM should show an indication that it has been switched to DFU mode
  12. if it fails), unplug the OpenMoko shortly and replug and try again (experience shows that it is needed up to three times)
  13. if it successfully flashed, you should be able to boot the OpenMoko and continue configuring AJZaurusUSB

The dfu-utils tool is included in the OpenMoko Flasher application; you can access it as OpenMoko Flasher.app/Contents/MacOS/dfu-util ; alternatively, you can compile dfu-util manually as described at http://wiki.openmoko.org/wiki/User:SNMoore

Connecting to your device

USB Serial

It is possible to access the U-Boot Bootloader serial console from a Mac. You can use the Terminal application on Mac OS X, or minicom from Fink or MacPorts (formerly Darwin Ports.)

The USB driver creates cu and tty character devices, for example

$ ls -la /dev/tty.usb*
crw-rw-rw-   1 root  wheel   10,  18 Aug 23 14:10 /dev/tty.usbmodem00000001
$ ls -la /dev/cu.usb*
crw-rw-rw-   1 root  wheel   10,  19 Aug 23 14:10 /dev/cu.usbmodem00000001

USB Serial with screen

The screen program is included with Mac OS X, and can be used from the terminal command line to connect to the serial console. To do this, simply get to a shell prompt in the terminal and invoke screen as follows:

% screen /dev/tty.usbmodem00000001

You should find yourself at the U-boot serial console prompt. To get out, type control+a followed by control+backslash.

USB Serial with minicom

The minicom program from the MacPorts collection can be used to access the USB serial port /dev/cu.usbmodem00000001 (numbering may vary.)

First install the program (assuming you already have MacPorts installed):

sudo port install minicom

Then launch it in configuration mode (the -s flag):

sudo minicom -s

Under "Serial Port Setup", set the Device to "/dev/cu.usbmodem00000001" and set Bps to "115200 8N1". Under "Modem and Dialing", enter empty strings for "Init string", "Reset string", and "Hang-up string". Save the setup as default ("dfl") then Exit.

You should now be able to access the bootloader console. You should exit from Minicom before disconnecting the smartphone, or else you will get an error about unplugging a USB device while it is in use.

USB Serial with Terminal

The built in Mac Terminal application Terminal.app can be used to access the USB serial port /dev/tty.usbmodem00000001 (numbering may vary.)

An easy way to do this is to configure the terminal with Script Editor, as described in the short article, Use 'screen' as a serial terminal emulator(macosxhints.com). Then,

  1. Press and hold AUX Button and then press and hold POWER for 5 seconds
  2. Press AUX Button to select Set console to USB in the U-Boot menu, and POWER to execute it
  3. Start the serial terminal application. You should see a U-Boot command line prompt, such as
In:    usbtty
Out:   usbtty
Err:   usbtty
DEVICE_CONFIGURED: 1
Enabling automatic fast charge
GTA01Bv4 #

When you boot Linux on the smartphone, or if the smartphone powers down, Mac OS X will show a USB Device Unplug Notice, "The USB device has been unplugged while an application was still active. This can result in loss of data." This error is probably harmless.

USB Networking

You can telnet, SSH, SMB or do whatever you want if you install software that enables you to set up TCP/IP network over your USB connection.


There are two drivers you can use to talk to the RNDIS/Ethernet Gadget that the neo1973 presents to its host system. For how you use them the only difference is in what shows up in your Network panel, but there are some difference in the technical details.

MacOS X 10.4.10 and later does provide such a driver for RNDIS/Ethernet Gadget. Launch System Prefs->Network and you should see "new interface detected enXX".

Each time you reboot, it will get a different Ethernet Address which requires to create a new configuration record on the Mac. This can lead to having a huge list of if you don't periodically clean them out by going Network -> Show(Network Port Configurations) -> Select an enXX -> Delete.


You can also use an open source (GPL) universal driver http://www.dsitri.de/wiki.php?page=AJZaurusUSB which is developed for handheld devices like iPAQ, Sharp Zaurus, and Motorola A760. Download it and install according to manual found inside of the package.

After reboot, you should have a new Ethernet interface in your System Preferences/Network. (XXX does this have the same problem as the Apple driver does, where it constantly adds to the list of interfaces each time you reboot the neo?)

Use this configuration on the new interface:

IP-V4: manual
IP-Addr:  192.168.0.200 (you can use anything in 192.168.0.* but OM is configured by default to use 192.168.0.200 as the external gateway)
Subnet:   255.255.255.0 (should be the default)
Router:   192.168.0.202 (not actually needed, OS X can figure this out for itself, unless you have other conflicting configurations)

This might conflict with some WLAN routers which also use the 192.168.0.0 network.

You should be able to connect to your Neo! Try using ping 192.168.0.202 and the roundtrip time should be between 1 and 2 ms.

NOTE: this driver is sometimes a bit flaky, and a reboot of the Mac seems to bring it back. It is especially critical about hot unplugging the OM and sleep modes of MacBooks. This may even result in a Kernel Panic.

Telnet, ssh, SMB

To Be Done.

ssh

After making the USB connection work, start ssh:

ssh -l root 192.168.0.202

If you don't have installed the key, it will ask for a "yes" on the first connection and for a password on each other. This is "root" unless you change it.

MacBook-hns:~ hns$ ssh -l root 192.168.0.202
root@192.168.0.202's password: 
root@fic-gta01:~$ hostname
fic-gta01
root@fic-gta01:~$

NOTE: the ssh daemon (dropbear 0.49) on the OpenMoko appears to have a bug when sending the exit status back to the client. From time to time you receive an exit status of 255.

Bluetooth

To Be Done. See also: Bluetooth_Support#PPP_Networking.

WiFi

To Be Done.

Synchronizing

This is not done yet. Possible solutions are SyncML or ZMacSync http://www.dsitri.de/wiki.php?page=ZMacSync

ZMacSync does not yet synchronize but allows more easy access to the OpenMoko through Terminal/ssh.

Sharing connection

Mac as a server

Here is described how to enable your Mac to serve as a internet router for your OpenMoko device.

Go to Control Panel, click Sharing and click the Internet tab. Check all the ethernet (en) interfaces you want to enable Internet access for.

SSH into your Neo and create /etc/resolv.conf, specify your Internet router IP address as the name server.

Example:

nameserver 192.168.1.200

Bluetooth

This could help:

http://wiki.openmoko.org/wiki/Bluetooth_Support#Networking

http://www.macosxhints.com/article.php?story=20051220221237711

USB

If you install AJZaurusUSB driver you should be able to set up your Mac as a router (not tested).

Neo1973 as a server

To Be Done.

Developing software

Using virtualization software

You can use Parallels or VMWare to install your favourite Linux distribution and then develop just as on Linux.

There are some drawback since AFAIK dfu-util may not work correctly in such environments.

Don't bother with Parallels Desktop for Mac (<=3), the current USB support is terrible and USB storage keys don't even work so there was no way I would try dfu-util. USB keys work under VMWare Fusion for Mac though I have yet to try dfu-util in an VM under VMWare Fusion as there is OpenMoko Flasher for Mac. -- Eric

Natively

There are some efforts to get through process of compiling OE and OpenMoko under mac: OpenMoko_under_QEMU_on_MacOSX

GNUstep/mySTEP SDK

There is a QuantumSTEP/mySTEP project to port GNUstep to the OpenMoko/Neo: http://www.quantum-step.com/wiki.php?page=OpenMoko-Edition An SDK for Xcode/Interface Builder is also available: http://www.versiontracker.com/dyn/moreinfo/macosx/20581 http://www.quantum-step.com/wiki.php?page=SDK

Other Resources

Search Software Repositories

[Keyword OpenMoko] at VersionTracker

Discussion Fora

[Mac Issues Forum] at Open Embedded Software Foundation (was Zaurus User Group)

Personal tools

Welcome to the OpenMoko page devoted to MacOS X users!

Here you can find notes of using Neo1973 (and maybe other OM devices) with Mac.

Flashing to your device

To operate the Phase 1 devices, you need to flash a root file system first.

NOTE: you need an Intel Mac to run dfu-util since it is currently broken on big-endian machines (PowerPC).

Here is a detailed instruction:

  1. If you don't have Mac OS X 10.4.10 (Apple already ships a more stable CDC ECM driver, and DFU through libusb doesn't need a driver at all):
    1. download the latest version of AJZaurusUSB from http://www.dsitri.de/wiki.php?page=AJZaurusUSB
    2. install
    3. run 'sudo kextload /System/Library/Extensions/AJZaurusUSB.kext' from Terminal (or reboot your Mac as described - but you do not need to configure AJZaurusUSB it before flashing the OpenMoko)
  2. download the latest version of OpenMoko Flasher from http://www.dsitri.de/wiki.php?page=OpenMoko%20Flasher
  3. [V1.0 only: create a new Folder at "~/Library/Caches/OpenMoko Flasher"]
  4. press the Refresh button (which loads the list of packages on the server)
  5. select and load the rootfs (takes some minutes for approx. 40 MByte)
  6. [V1.0 and V1.1 only: open the Console application and show the console.log]
  7. Now, on your OpenMoko, hold the AUX button while pressing the Power button for 5 seconds
  8. the BOOT menu should appear
  9. connect the USB cable
  10. Press the Flash button
  11. the BOOT menu screen on the OM should show an indication that it has been switched to DFU mode
  12. if it fails), unplug the OpenMoko shortly and replug and try again (experience shows that it is needed up to three times)
  13. if it successfully flashed, you should be able to boot the OpenMoko and continue configuring AJZaurusUSB

The dfu-utils tool is included in the OpenMoko Flasher application; you can access it as OpenMoko Flasher.app/Contents/MacOS/dfu-util ; alternatively, you can compile dfu-util manually as described at http://wiki.openmoko.org/wiki/User:SNMoore

Connecting to your device

USB Serial

It is possible to access the U-Boot Bootloader serial console from a Mac. You can use the Terminal application on Mac OS X, or minicom from Fink or MacPorts (formerly Darwin Ports.)

The USB driver creates cu and tty character devices, for example

$ ls -la /dev/tty.usb*
crw-rw-rw-   1 root  wheel   10,  18 Aug 23 14:10 /dev/tty.usbmodem00000001
$ ls -la /dev/cu.usb*
crw-rw-rw-   1 root  wheel   10,  19 Aug 23 14:10 /dev/cu.usbmodem00000001

USB Serial with screen

The screen program is included with Mac OS X, and can be used from the terminal command line to connect to the serial console. To do this, simply get to a shell prompt in the terminal and invoke screen as follows:

% screen /dev/tty.usbmodem00000001

You should find yourself at the U-boot serial console prompt. To get out, type control+a followed by control+backslash.

USB Serial with minicom

The minicom program from the MacPorts collection can be used to access the USB serial port /dev/cu.usbmodem00000001 (numbering may vary.)

First install the program (assuming you already have MacPorts installed):

sudo port install minicom

Then launch it in configuration mode (the -s flag):

sudo minicom -s

Under "Serial Port Setup", set the Device to "/dev/cu.usbmodem00000001" and set Bps to "115200 8N1". Under "Modem and Dialing", enter empty strings for "Init string", "Reset string", and "Hang-up string". Save the setup as default ("dfl") then Exit.

You should now be able to access the bootloader console. You should exit from Minicom before disconnecting the smartphone, or else you will get an error about unplugging a USB device while it is in use.

USB Serial with Terminal

The built in Mac Terminal application Terminal.app can be used to access the USB serial port /dev/tty.usbmodem00000001 (numbering may vary.)

An easy way to do this is to configure the terminal with Script Editor, as described in the short article, Use 'screen' as a serial terminal emulator(macosxhints.com). Then,

  1. Press and hold AUX Button and then press and hold POWER for 5 seconds
  2. Press AUX Button to select Set console to USB in the U-Boot menu, and POWER to execute it
  3. Start the serial terminal application. You should see a U-Boot command line prompt, such as
In:    usbtty
Out:   usbtty
Err:   usbtty
DEVICE_CONFIGURED: 1
Enabling automatic fast charge
GTA01Bv4 #

When you boot Linux on the smartphone, or if the smartphone powers down, Mac OS X will show a USB Device Unplug Notice, "The USB device has been unplugged while an application was still active. This can result in loss of data." This error is probably harmless.

USB Networking

You can telnet, SSH, SMB or do whatever you want if you install software that enables you to set up TCP/IP network over your USB connection.


There are two drivers you can use to talk to the RNDIS/Ethernet Gadget that the neo1973 presents to its host system. For how you use them the only difference is in what shows up in your Network panel, but there are some difference in the technical details.

MacOS X 10.4.10 and later does provide such a driver for RNDIS/Ethernet Gadget. Launch System Prefs->Network and you should see "new interface detected enXX".

Each time you reboot, it will get a different Ethernet Address which requires to create a new configuration record on the Mac. This can lead to having a huge list of if you don't periodically clean them out by going Network -> Show(Network Port Configurations) -> Select an enXX -> Delete.


You can also use an open source (GPL) universal driver http://www.dsitri.de/wiki.php?page=AJZaurusUSB which is developed for handheld devices like iPAQ, Sharp Zaurus, and Motorola A760. Download it and install according to manual found inside of the package.

After reboot, you should have a new Ethernet interface in your System Preferences/Network. (XXX does this have the same problem as the Apple driver does, where it constantly adds to the list of interfaces each time you reboot the neo?)

Use this configuration on the new interface:

IP-V4: manual
IP-Addr:  192.168.0.200 (you can use anything in 192.168.0.* but OM is configured by default to use 192.168.0.200 as the external gateway)
Subnet:   255.255.255.0 (should be the default)
Router:   192.168.0.202 (not actually needed, OS X can figure this out for itself, unless you have other conflicting configurations)

This might conflict with some WLAN routers which also use the 192.168.0.0 network.

You should be able to connect to your Neo! Try using ping 192.168.0.202 and the roundtrip time should be between 1 and 2 ms.

NOTE: this driver is sometimes a bit flaky, and a reboot of the Mac seems to bring it back. It is especially critical about hot unplugging the OM and sleep modes of MacBooks. This may even result in a Kernel Panic.

Telnet, ssh, SMB

To Be Done.

ssh

After making the USB connection work, start ssh:

ssh -l root 192.168.0.202

If you don't have installed the key, it will ask for a "yes" on the first connection and for a password on each other. This is "root" unless you change it.

MacBook-hns:~ hns$ ssh -l root 192.168.0.202
root@192.168.0.202's password: 
root@fic-gta01:~$ hostname
fic-gta01
root@fic-gta01:~$

NOTE: the ssh daemon (dropbear 0.49) on the OpenMoko appears to have a bug when sending the exit status back to the client. From time to time you receive an exit status of 255.

Bluetooth

To Be Done. See also: Bluetooth_Support#PPP_Networking.

WiFi

To Be Done.

Synchronizing

This is not done yet. Possible solutions are SyncML or ZMacSync http://www.dsitri.de/wiki.php?page=ZMacSync

ZMacSync does not yet synchronize but allows more easy access to the OpenMoko through Terminal/ssh.

Sharing connection

Mac as a server

Here is described how to enable your Mac to serve as a internet router for your OpenMoko device.

Go to Control Panel, click Sharing and click the Internet tab. Check all the ethernet (en) interfaces you want to enable Internet access for.

SSH into your Neo and create /etc/resolv.conf, specify your Internet router IP address as the name server.

Example:

nameserver 192.168.1.200

Bluetooth

This could help:

http://wiki.openmoko.org/wiki/Bluetooth_Support#Networking

http://www.macosxhints.com/article.php?story=20051220221237711

USB

If you install AJZaurusUSB driver you should be able to set up your Mac as a router (not tested).

Neo1973 as a server

To Be Done.

Developing software

Using virtualization software

You can use Parallels or VMWare to install your favourite Linux distribution and then develop just as on Linux.

There are some drawback since AFAIK dfu-util may not work correctly in such environments.

Don't bother with Parallels Desktop for Mac (<=3), the current USB support is terrible and USB storage keys don't even work so there was no way I would try dfu-util. USB keys work under VMWare Fusion for Mac though I have yet to try dfu-util in an VM under VMWare Fusion as there is OpenMoko Flasher for Mac. -- Eric

Natively

There are some efforts to get through process of compiling OE and OpenMoko under mac: OpenMoko_under_QEMU_on_MacOSX

GNUstep/mySTEP SDK

There is a QuantumSTEP/mySTEP project to port GNUstep to the OpenMoko/Neo: http://www.quantum-step.com/wiki.php?page=OpenMoko-Edition An SDK for Xcode/Interface Builder is also available: http://www.versiontracker.com/dyn/moreinfo/macosx/20581 http://www.quantum-step.com/wiki.php?page=SDK

Other Resources

Search Software Repositories

[Keyword OpenMoko] at VersionTracker

Discussion Fora

[Mac Issues Forum] at Open Embedded Software Foundation (was Zaurus User Group)