Archive for the ‘OS X’ Category

How to send a SMS message from Mac with Screen

December 2, 2008

I just received my GMS 862 Evaluation Board and here is how I managed to send my first SMS message (by reading this article and some trial and error):

  • Install the Virtual Com Port Driver (if you’ve already not done that) to be able to use USB to communicate with the board.
  • Connect the board to the USB port on your Mac. The red light on the board will light up indicating that it is getting power.
  • On the Mac, start the Terminal application
  • Find out the “name” for the serial port: issue the command ls /dev/tty.* 
  • The name will be something like /dev/tty.usbseria;-A80081n2
  • Start a serial session by using the screen application: issue the command screen /dev/tty.usbseria;-A80081n2 115200. To end the screen session enter control-a \
  • Start the GSM module (this is critical, if you don’t start it up then anything you type on the screen session simply wont show up and the AT commands will, of course, wont be sent to the GSM module. You can start up the module, by pressing and holding the little start button on the evaluation board for at least 1 second.
  • Issue the following 3 AT commands:


AT+CMGF=1
OK
AT+CMGW="+14081234567"
> HELLO WORLD!
+CMGW: 1

OK
AT+CMSS=1
+CMSS: 3

OK

The command AT+CMGF=1 will format SMS as a TEXT message.

The command AT+CMGW provides the phone number you wish to send the SMS message to. When you hit enter, the GSM module responds with >. Now you can enter your text message and you terminate it with control-z. The message is read into memory and the module replies with the message index.

The command AT+CMSS=1 sends the SMS message with the specified index.

Here is an excellent introduction to the SMS AT commands.

AVR Programming on Mac

November 23, 2008

AVR programming on the Mac (Leopard) is a lot easier with AVR MacPack. It is kind of integrated with Xcode too. But builds via Xcode didn’t work for the sample demo project.

CISCO VPN Error 51 on the Mac

November 11, 2008

Every once is a while the CISCO VPN client on my Mac refuses to start with and displays the Error 51 dialog. Once you get this error, the only option is to reset the client:

 

sudo /System/Library/StartupItems/CiscoVPN/CiscoVPN restart

Mac OS X, Perl and SSL

August 30, 2008

Perl on MAC does not support SSL out of the box. So you must install SSL support:

sudo perl -MCPAN -e "install Crypt::SSLeay"

How to log MySQL queries on OS X

July 30, 2008

The default MySQL installer for OS X also includes a startup item that is added to the Mac System Properties thru which you start and stop MySQL. For development purposes, I needed to be able to tail the query log. According to the documentation, you can pass –log=path-to-log-file to the startup script, or add a log entry to the [mysqld] section of /etc/my.cnf file. The latter is the easiest way of creating a query log on OS X. Here are the steps that you need to follow:

  1. Create the file /etc/my.cnf (if you already don’t have one) and add the following lines:
    [mysqld]
    log=/var/log/mysqld.log
  2. su (become root)
  3. cd /var/log
  4. touch mysqld.log
  5. chmod 777 /var/log/mysqld.log
  6. Restart MySQL
Now you should be able to tail -f /var/log/mysqld.log

Disk Warrior & damaged Journaling data

May 15, 2008

If an application on OS X has damaged the Journaling data, then when you try to run Disk Warrior, you may get this error:the new directory cannot replace the original directory due to a mac os services failure. You may be able to work around this problem by temporarily turning off Journaling via Disk Utility:

  1. Open Disk Utility
  2. Select the Volume of the drive
  3. Hold down the Option key on the keyboard
  4. Go to the File menu – select Disable Journaling

Now run Disk Warrior again. Afterwards, you can turn back journaling. I spend many hours trying to get Disk Warrior to rebuild my file-system and after many futile searches, I contacted the Disk Warrior Support, and they suggested this solution. The good news is that in my case it worked.

OS X 10.5, SyncServer takes 100% of CPU

May 6, 2008

For the past couple of days a process called SyncServer started every 15 minutes or so and it would take over a 100% of the CPU on my MacBook Pro. Not quite sure what initiated this problem, but I found the remedy discussed in this Apple support case to be useful and apparently effective (well at least so far). I did have .Mac and BlackJack synchronization, so not sure if either of these applications caused this problem or not.

Here is the command that you’ll need to run (broken into a set of cd commands to fit the width of this column).
$ cd /System/Library/Frameworks/
$ cd SyncServices.framework/Versions/
$ cd A/Resources/
$ ./resetsync.pl full

How to change the default version of JDK on the Mac

May 4, 2008


Mac Java Preferences
On the Mac, there is an application called Java Preferences. You can use the Spotlight to find it. Launch the Java Preferences and in the Java Application Runtime Settings panel, drag the version of the JDK that you wish to use to the top. Save and restart any terminal applications that you may have had opened and you should be set.

How to get the set of open files/ports for a process

October 26, 2007

Every once in a while I need to know the set of files/ports that a process on OS X has opened. I have been using the Activity Monitor for a while but was unaware that this tool also provided this kind of information. In Activity Monitor, just select the process of interest and then click on the Inspect button, and then on the Open Files and Ports button. Here is a screen-cast to show you how.

Eclipse and Perforce plug-in

October 23, 2007

This morning, eclipse refused to start again on my Mac laptop. The following lines were in the .metadata/.log file:


!SUBENTRY 1 org.eclipse.ui.workbench 2 0 2007-10-23 14:50:10.999
!MESSAGE Conflict for 'com.perforce.team.ui.actions.unlock':
HandlerActivation(commandId=com.perforce.team.ui.actions.unlock,
handler=ActionDelegateHandlerProxy(null,com.perforce.team.ui.actions.UnlockAction),
expression=WorkbenchWindowExpression(org.eclipse.ui.internal.WorkbenchWindow@b0f929),sourcePriority=16384)
HandlerActivation(commandId=com.perforce.team.ui.actions.unlock,
handler=ActionDelegateHandlerProxy(null,com.perforce.team.ui.actions.UnlockAction),
expression=WorkbenchWindowExpression(org.eclipse.ui.internal.WorkbenchWindow@b0f929),sourcePriority=16384)

Deleting the .metadata/.lock file fixed the problem. I’m not sure what caused this problem, but deleting the .lock file did fix it.


Follow

Get every new post delivered to your Inbox.