M2M

jmumby

Senior Member
Hi all,

Has anyone sucsessfully interfaced with a cellphone to send out serial data? Or should I say open a modem connection with a cellphone and send data.

I want to be able to send data from a GPS via a cellphone to webserver and from threads I have found it's a tall ask due to the high speeds and bizarre protocols of cellphones.

Anyone have any picaxe friendly cellphones they can think of?

Cheers,

Jason
 

SilentScreamer

Senior Member
Try searching, I've seen several threads on this before. "Cellphone send data" and "Mobile phone send data" are two good starting points.
 

jmumby

Senior Member
jmumby said:
I want to be able to send data from a GPS via a cellphone to webserver and from threads I have found it's a tall ask due to the high speeds and bizarre protocols of cellphones.

Try searching, I've seen several threads on this before. "Cellphone send data" and "Mobile phone send data" are two good starting points.
Thanks SS but I was after someone that has beaten a road down this path, saves reinventing the wheel.
 

demonicpicaxeguy

Senior Member
Hi all,

Has anyone sucsessfully interfaced with a cellphone to send out serial data? Or should I say open a modem connection with a cellphone and send data.

I want to be able to send data from a GPS via a cellphone to webserver and from threads I have found it's a tall ask due to the high speeds and bizarre protocols of cellphones.

Anyone have any picaxe friendly cellphones they can think of?

Cheers,

Jason
the old nokia 5110 wasn't a bad phone for this sort of thing, the problem now days is finding one, and the connector for it
 

jmumby

Senior Member
the old nokia 5110 wasn't a bad phone for this sort of thing, the problem now days is finding one, and the connector for it
Chuckle, that pretty much raised my query! I just found two BOXED 5110i's in a pile of junk at my mums house. And I just got a cable off a local auction site for $4.50. Looks like f-bus,m-bus research coming up.
 

lanternfish

Senior Member
Am working on a similar project at the moment - GPS to 28X2(20X2) to Cell for recovery of a high-power rocket (expected altitude approx. 1000m). Sjould the rocket drift out of site, a quick txt to it will reveal its location (I hope).

The first trick is the BDU conversion of the GPS ASCII (7-bit) to 8-bit bytes. I have a block of code that works, though it will need optinmising and better annotation.

Code:
' Variables

SYMBOL txtptr1 = b11			; Byte (n) Text Buffer Pointer
SYMBOL txtptr2 = b12			; Byte (n+1) Byte in Text Buffer
SYMBOL bduptr  = b13			; BDU Buffer pointer
SYMBOL byte1   = b14			; BDU Conversion bytes
SYMBOL byte2   = b15			; BDU Converted Byte to store in BDU SMS buffer
SYMBOL result  = b16			; BDU Conversion Result
SYMBOL multi   = b17			; BDU Multiplier
SYMBOL divisor = b18			; BDU Divisor
SYMBOL txtlen  = b20			; Length of txt to convert

'********************************************************************************
	
'				 ASCII To PDU Conversion

'********************************************************************************

ASCII2PDU:

InitialiseBDUConverter:

	txtptr1 = 0                                        ; Point to start of text string - byte (n)
                                                              ; - to convert
	txtptr2 = txtptr1 + 1                           ; Point to next byte (n+1)
	bduptr = txtlen + 5                             ; Point to first storage address
	
ConvertASCIIToPDU:

	multi = 128
	divisor = 2
	counter1 = 0
	
	DO UNTIL counter1 = 7
	
		GET txtptr1,byte1
		GET txtptr2,byte2
			
		IF byte2 = 255 THEN GOTO LastBDUByte     ; This marks the end of the text
			                                                   ; to convert
		result = byte2 // divisor
		result = result * multi
		byte1 = byte1 OR result
		PUT bduptr,byte1

		byte2 = byte2 / divisor
		PUT txtptr2,byte2
			
		INC txtptr1
		INC txtptr2
		INC bduptr
		multi = multi / 2
		IF multi = 1 THEN LET multi = 128:ENDIF
		divisor = divisor * 2
		IF divisor = 256 THEN LET divisor = 2:ENDIF
		
		INC counter1

	LOOP
		
		INC txtptr1
		INC txtptr2	
		INC txtctr
		GET txtptr1,byte2
		IF byte2 = 255 THEN 
			GOTO LastBDUByte
		ELSE 
			GOTO ConvertASCIIToPDU
		ENDIF

LastBDUByte:

		PUT bduptr, byte1	
		
	RETURN
I am using Nokia (3210 & 6110) to try this with. There is a lot of info on the interweb for communicating serially with Nokia phones through their F-Bus.

Some starting links are:

"pdu-format-of-sms"

"nokia fbus"

I am still writing the code for serial to cell phone. Nokias require an initial string of 128 "U"'s. Then a rather long sequence which includes the called number, length of text, and a few control bytes, followed by the text. This part doesn't seem to be that tricky. Time will tell.

Hope this helps
 
Last edited:

lbenson

Senior Member
The Motorola V195S proved easy for this. I tested a year or more ago only with (USB) serial from an NSLU2 and typing and getting a response and calling through a terminal program. It seemed eminently picaxeable. I don't remember whether or not I had to do a conversion to 3.3 volts.

In fact, thinking back and remembering dimly, it may have been USB to mini-usb--which would make it harder for the picaxe.

Even with the appropriate cable it may be hard to get the required speed from a picaxe--often 115K.
 

lanternfish

Senior Member
The 28X1/2 parts are quite capable of 115K baud on the hserin/out pins.

As for the 5V to 3.3V Serial conversion, there are a number of handy circuits around. The best and easiest bidirectional level converter uses a fet and two resistors here.
 

MPep

Senior Member
@JMumby,
Are you after a serial data connection? Many cellphones use a USB connection. Good luck.
Maybe Laternfish's SMS code is more applicable here?
Guess it depends if your server can receive SMS, or at least extract data from an email.
In NZ, if you send a text, through Vodafone, to 021 010 099, and in the SMS part start of with an email asddress, then you can receive a text via your standard email client.
If you want to send an SMS (email) to the cellphone, you MUST send R to 901. This is so that Vodafone charge the cellphone (actually the SIM in the phone) for receiving a text.

@Laternfish:
You are discussing SMS protocol, correct?
Interesting that you have it working.
I have been meaning to get PDU working on PICAXE.
I have seen code for PIC Stamp, that I was going to convert.
 

lanternfish

Senior Member
@Laternfish:
You are discussing SMS protocol, correct?
Interesting that you have it working.
I have been meaning to get PDU working on PICAXE.
I have seen code for PIC Stamp, that I was going to convert.
Yes. I chose to go with BDU conversion because there was a fair amount of practical experience available on the interweb with Nokias and BDU. Straight text would seem to be easier, though I haven't tried that with the Nokia.

Was a mission to get my head around parts of it, thus the messy code. I started when I located some VisualBasic code. By using a 28X2 (and hopefully a 20X2 to reduce PCB footprint) I can use hserin operating at 115kb in the background. And the larger scratchpads mean I have plenty of memory to act as buffers for the GPS (also using hserin in background), BDU and SMS strings. The GPS and F-Bus serial is switched via a 74HC157.

The GPS receiving works great. The BDU conversion works well - just needs optimising. Though with a 28X2 'overclocked' to the max, and the whole system not being time critical, a bit of messy code shouldn't be too much of a problem.

I am still mucking around with Hyperterminal and the Nokia to ensure things are being sent and received correctly before committing to PICAXE code.

This is probably another thread however, it would be great if the hserout command could be something like:

hserout break, pointer, length where pointer is an address in scratchpad and length is the length of the pseudo-string.

Cheers

Must have a look for Stamp basic code.
 

jmumby

Senior Member
@JMumby,
Are you after a serial data connection? Many cellphones use a USB connection. Good luck.
Maybe Laternfish's SMS code is more applicable here?
Guess it depends if your server can receive SMS, or at least extract data from an email.
In NZ, if you send a text, through Vodafone, to 021 010 099, and in the SMS part start of with an email asddress, then you can receive a text via your standard email client.
If you want to send an SMS (email) to the cellphone, you MUST send R to 901. This is so that Vodafone charge the cellphone (actually the SIM in the phone) for receiving a text.
This is the cable I bought http://www.trademe.co.nz/a.asp?id=228855447 ahhh trademe. I was hopeing to do the GPRS thing but the 5110i is WAY to old to attempt that. This is a cheap proof of concept before I try one of these http://www.sparkfun.com/commerce/product_info.php?products_id=7917

Thanks for that info tho, very interesting.
 
Top