- Logger is a midlet, a Java program that runs on your cell phone.
- The purpose is to store information coming in via Bluetooth from say a microcontroller or gps device. Then later be able to upload the stored information to your desktop computer or to a server.
- You can get this midlet (together with BTTerminal utility) from Cell.jar Your machine try to rename it .zip when you download it but but put it back to .jar.
- You can tranfer it to your phone most easily via bluetooth from your computer. Play around with the bluetooth capabilities until you see how to send a file to another device. You can also using the pc suite (usually pc only) or even from the web.
- If you send it via bluetooth it will arrive as a text message on your phone. If you go to read that text message, the phone will automatically offer to install the midlet. Say yes to all the prompts in the intallation process and put it on the memory card for more storage.
- Now you have to track down where it was installed, try the "Applications" folder or the "My Own" folder.
- Start Logging --Make the preferences of the bluetooth connection on the phone conform to how your bluetooth device is sending the data (eg linefeed 10 character after each reading).
- Stop Logging
- Upload --Make sure there is something on the other side of whatever style of upload that you picke (ie upap.php for HTTP, or Downloader App for BT or Socket). See the bottom of this page for the "The Receiving End"
- If you have problems read all the below for details.
- Log Info (a log contains many records)
- Name of Current Log
- Name of Input Device
- Amount of Storage Used
- Date Last Modified
- Record Info
- Which Record you are on. Press the 4 key for the previous record, 6 key to go to the next record
- Date recorded
- Number of records added since last pressing "start logging"
- Contents -- the beginnings of the contents of the record
- Start Logging -- Presents an interface for connecting to a bluetooth device.
- Address Field -- You can type in the address you want to connect to using the "Direct" option (see below). The previous address you used will be recorded there but the first time you use the midlet so usually you have to use the slow "Discover Services" (see below) the first time to capture your address in this field and then "Direct" thereafter.
- Direct allows you to connect directly to the device specified at the top.
- Discover Services -- This starts a two step process. First it disovers the devices in range and allows you to pick one. This can take quite a while. Then it presents all the services within the device, you want the one that sounds most like generic serial device.
- Discover Quicker -- This starts a one step discovery process. It searches for devices but assumes that you want the first service on the device (good bet on devices like the bluesmirf that only have one service).
- Wait For Connection -- This reverses the rolls and makes your phone the server for a client to connect to.
- Options Menu
- Show/Hide Preferences -- Toggles the preferences for the connection
- Delimiter of Incoming
- None Continuous Stream
- End Char
- Transmission Length
- Start Char and Transmission Length
- End Char
- Start Char
- Flow Control Need to Request
- Request Char
- Stop Logging -- stops recording samples and disconnects the bluetooth connection.
- Upload --Allows you to get the data from the record stores on the phone onto your computer
- Options> Preferences
- Base Filename --
- Upload Log Records --
- Append Existing File
- Allow Bunching (faster)
- Size of Chunks(Bytes)
- Insert Into Filename
- TimeStamp (no append or bunch)
- Time and Meta (no append or bunch)
- Content Formatting
- T.S. Data Meta Raw Bytes
- Data Meta Raw Bytes
- Data Raw Bytes
- T.S.,Data, Meta, ASCII
- Sep Files (no append/bunch)
- Upload BT -- Use Bluetooth to transfer the data. This assumes that you are using the the Downloader App and that you have used your bluetooth control panel to assoicate bluetooth on your machine with a serial port.
- Address Field -- You can type in the address you want to connect to using the "Direct" option (see below). The previous address you used will be recorded there but the first time you use the midlet so usually you have to use the slow "Discover Services" (see below) the first time to capture your address in this field and then "Direct" thereafter. Note that the service is follows the hardware address separated by a colon.
- Direct allows you to connect directly to the device specified at the top. Note that the service is follows the hardware address separated by a colon.
- Discover Services -- This starts a two step process. First it disovers the devices in range and allows you to pick one. This can take quite a while. Then it presents all the services within the device, you want the one that sounds most like generic serial device. You will have to go into the bluetooth control panel on your computer and associate a serial port with bluetooth. You might give it an unusual name so you will recognize it.
- Discover Quicker -- This starts a one step discovery process. You should avoid this because you are probably connecting to bluetooth acting as a serial port service on your regular computer which has many service.
- Wait For Connection -- Won't work with Downloader. This reverses the rolls and makes your phone the server for a client to connect to.
- Options Menu
- Show/Hide Preferences -- Toggles the preferences for the connection. You can see the options above in "Start Logging" but these are mostly for recieving data and we are mostly sending.
- Upload HTTP -- This assumes that you either have a data plan (watch the per kb charges) or you can connect from your phone via WIFI. It also assumes that you have installed the upap.php program on your machine and have created an web writable "up" directory in the same folderor you are using the one on my machine.
- Address Field --Input a url of the upap.php file and optionally a filename separated by a space.
- Upload TCP/IP Socket -- This assumes that you are using the the Downloader App and that you either have a data plan (watch the per kb charges) or you can connect from your phone via WIFI.
- Address Field -- File in the IP address of the machine running the downloader program and the port number that you have put into the downloader program. Separate the IP and the port by a space.
- Pick Direct and it should make a connection
- Options Leave the options alone those are mostly for recieving and we are mostly sending.
- Choose Log -- You can have different log files. By default the log file is called "Default" If you want another log file fill in a name where it says "blank" and choose "Create New Log" .
- Delete Log -- Deletes the current log and all the data.
- Clear Log -- Clears the current log of all data.
- Ask For Input -- In cases where your bluetooth device requires a prompt to send data, choosing this menu item send over the character specified in the preferences of your connection.
- Hide/Show Preferences -- Toggles between main view and preferences
- Interval specifies how many milliseconds between samples. If your device requires a prompt, the prompt will be sent at this interval. If your device is constantly sending the only samples at this interval will be saved.
- Do you want each sample be be timestamped.
- Add Phony Data -- For debugging. If you want to concentrate on getting upload to work, this puts new phony data ("ABC" then "DEF"...) into the log to save you from having to connect to a real device.
- If you would like to see the code behind the Logger and write your own midlets go here
The Recieving End Options
- This upap.php code takes the data from the phone and puts it on the server in a folder called "up".
- You can put the upap.phh on your server and put a folder in the same directory called "up" Give that folder permissions to be written to by the web (777).
- You can also use the upap.php that is on my server itp.nyu.edu/~dbo3/upap.php and then you will find your data here Or even better you can use my upap.php but put the data in a folder in your account by specifying a file name after the url in the MIDlet like this "http://itp.nyu.edu/~dbo3/upap.php /home/public_html/yournetid/up/yourLogFileName.log"
- simpler php code
Downloader for BlueTooth and Socket
- Downloader is a Java application for getting data from the Logger Midlet. It will recieve either via a TCP/IP Socket Connection or via a Serial Connection. This software is very fresh so be patient.
- Get all the files from here You may have to rename Downloader.zip to Downloader.jar On the pc you will need rxtxSerial.dll in the same folder. If it doesn't work also put these in Program Files/Java/jre.../bin/ . On the mac you need to put and on the Mac you will need librxtxSerial.jnilib and librxtxSerial.so and RXTXcomm.jar in Libraries/Java/Extensions on the Mac. You might also have to run the macox_setup_command file if you get "port in use problems".
- Run the Downloader.jar app by double clicking on it. (If .jar is not mapped to java on your computer you will have to type "java -jar Downloader.jar" instead.)
- It will ask you for the directory where you want to put the data. (you can specify this directory on the command line like this "java -jar Downloader.jar Directory:C:\BTPictures\"
- It will try to show the contents of each file in the directory. This is just for preview, if you really want to look at your data you should use a text editing program.
- You should specify the ports (socket or serial) that you want to use. You can also specify these on the command line "java -jar Downloader.jar Baud:9600 SerialPort:COM5" You might run into problems with something like port in use (particularly on the mac) and you should follow the same proceedure you did in processing for getting it freed up.