Archive for January, 2009

On several occasions I have been asked how to add more data to an existing file in the flash memory of our TC65 or XT65 modems (or MTX terminals from Matrix). So today I am going to post a small Java program to help those of you who don’t know how to do this. It’s very simple.

Basically you use the OutputStream object instead of the DataOutputStream (DataOutputStream comes from OutputStream) which I’m sure you saw in the post where the majority of the Java examples are.

Let’s look at a little example today. Let’s assume that we have a file in the modem’s file system called  ”A:/file.txt“ with the text “hola”. If you don’t have one, make one and put it in the modem.

Blog de Electrónica Avanzada

/* Create an object in the FileConnection class and specify the name of the file to open, which will be file.txt*/
FileConnection objFileConnection = (FileConnection)
Connector.open(“file:///a:/file.txt”);

/*Check the current file size*/
long fileSize=objFileConnection.fileSize();

/*Create an object in the OutputStream class. With this we can write data in the file and pass it off as a current file size parameter so that the file writing “pointer” is at the end of the file.*/
OutputStream objOutputStream = objFileConnection.openOutputStream(fileSize);

/*Write the text “Adios” inside the file that we have just opened (or created)*/
objOutputStream.write(“adios”.getBytes());

/*Send it writing everything that’s left in the buffer prior to closing it*/
objOutputStream.flush();

/*Close the object*/
objOutputStream.close();

/*Close the file*/
objFileConnection.close();

Once you run the application, if you look at the flie.txt contents you will see that the contents include “holaadios” i.e. it doesn’t overwrite the contents that’s already in the file, it adds the data.

To summarize, I will put up a few posts about two new terminal models, the MTX65+Gv3 (GPRS terminal modem with GPS) and the new MTX65-ULP (GPRS ultra low power modem). Firstly we will look at their features and then I will go into more detail about programming both devices, paying attention to the peculiarities of each one so that everyone will know exactly how to use them. I’m sure you’ll like it. This will be in a few days time.

I hope it’s been interesting for you. ;)

Tags: , , , , , , ,

Comments 7 Comments »

On several occasions I have been asked how to create a dial-up network connection with an MTX63 GPRS modem or an MTX-HC25 UMTS/ HSDPA modem. Sure it’s obvious for most of us, but not for people who are less accustomed to using modems (this is normal as nobody is born with this knowledge, but throughout my life I have met people who strangely seem to think otherwise…).

So for those of you who don’t know how to do it, here are the steps for how to create a dial-up network connection via USB for the MTX63 and MTX-HC25. Actually the following applies to any modem, either for the modems mentioned before, for the MTX65 or the MTX65+G or even mobiles if you can connect them via USB so that they act as a gprs or umts modem.

Acecso telefónico a redes
How to create a dial-up network connection with a GPRS/UMTS modem (with Windows XP):
1.-Install the modem’s USB driver.
2.-Click on the “Start” menu -> Connect to -> Show all connections
3.-Go on the left hand menu -> click on “Create a new connection”.
4.-Click on the button “Next”
5.-Select “Connect to the Internet”. Click the “Next” button.
6.-Select “Set up my Connection Manually”. Click the “Next” button.
7.-Select “Connect Using a Dial-Up Modem”. Click the “Next” button.
8.-Select the modem from the list (Siemens AG WM USM… or whatever is it). Click “Next”.
9.-Give the connection a name e.g. “SIEMENS Connection”. Click “Next”.
10.-Put *99***1# in the telephone number. Click “Next”.
11.- Select “Used by Anyone”. Click “Next”
12.-In the username put MOVISTAR, vodafone or CUSTOMER depending on whether it’s Telefónica, Vodafone or Orange respectively. You will have to consult other operators. In the password put MOVISTAR, Vodafone, AMENA depending on whether it’s Telefónica, Vodafone or Orange. You will have to consult other operators. Take care with the capital letters in the login and password. Click “Next”.
13.- Press the “Finish” button.
14.- Now open the Windows “Control Panel” -> Select System -> Hardware Tab –> Device Manager -> Select modem -> Right click Modem Properties (The Siemens/Cinterion one or the one that you are configuring) -> Advanced Options. In Additional Initialization Commands put:
If it’s Telefónica:
+CGDCONT=1,”IP”,”movistar.es”
If it’s Vodafone:
+CGDCONT=1,”IP”,”airtelnet.es”
If it’s Orange:
+CGDCONT=1,”IP”,”internet”
Press the Accept button.

15.-The button is now ready for the connection. Just double click on the network’s connection icon in network connections to start the connection.

I hope that is will help someone. ;)  

P.S. I am making some very important changes to the blog so sorry if you ever can’t read the posts properly, if the image isn’t in the centre or if there are problems with accents (I’m fighting with the UTF-8 and the ISO-8859-1). I hope that the changes will be positive in the end.

Tags: , , , , ,

Comments 2 Comments »