From JavaCint
Jump to: navigation, search


1 Where can I find technical support for the TC65?

You have to ask your TC65 supplier. It will redirect you to a company in charge in your region. Some companies seem better than other, some won’t even know that the chip can be used with java programs and some can give you precise technical information. If you want a free and unofficial support, you can contact the javacint group. Please note that this group doesn’t offer support for Cinterion chips that don’t support java.

2 What about watchdog ?

You should absolutely use a hardware watchdog with a period of at least 3 minutes to be able to perform some over the air provisioning. The TC65 is not reliable and its internal watchdog isn't either.

3 I have an ^EXIT error

Go here

4 Can i use a GPRS connection with both a running java program and my PC?

No. The chip either does java or modem. You could might be able to simulate a modem within a java app. But this doesn't seem like a good idea.

5 How can I upgrade a program remotly?

You can:

  • Execute an "AT^SJOTAP" command triggered by an SMS, a network command or any special event you want
  • Send an OTAP SMS. This will launch the update on any chip you want. You can do that by using my little SMSOTAP software and another GPRS modem.

6 Can I prevent the chip from shutting down and not waking up?

This problem of the chip shutting down with the “^SHUTDOWN” URC and not waking up is a big one but I think it only occurs on TC65 v1 chips. Some people send a restart command in the destroyApp method. It has the obvious drawback of preventing the chip of being remotly upgraded.

In fact you CAN upgrade your program even with this fix. You have to set your chip to wait for the maximum time before program starts (AT^SCFG=”Userware/Autostart/Delay”,”250″ ie 25 seconds) at startup. You make the chip restart with a first OTAP SMS (or any other restart command) and then send an other OTAP SMS within this 25 seconds restart time.

7 Debugging on TC65 doesn’t work

First of all, make sure you debug with the tools intended for your chip. Debugging might not work or work weirdly (no variable state visible for instance) with incompatible versions.

You also have to make sure the “remote debugging connection” works fine. Everytime you change something in your configuration, make sure to use Cinterion (or Siemens) setup utility to “repair” the debugging connection.

8 How can I get a .jar file from the TC65?

You can’t. As you may not know, jar files can be very easily decompiled and even obfuscated reveal the logic of your chip. This is a very basic and powerful way to prevent your software from being reverse-engineered. You can upload jar file on the chip but never download jar file from the TC65.

9 Can we save a lot of data on the chip?

I has 1.7 MB of memory. Chances are you are only using 5 to 100 kB for your java code. So it enables you to save a lot of data.

Note : I have never been faced wit this problem but the memory used by the TC65 chip is limited to approximatively 100 000 read/writes. So you should avoid to write things too often.

What you can and you should save are settings required to communicate with the chip.

10 Can we use an SD-Card or any kind of flash storage system with the TC65?

In the SDK documentation, the File:AN 17 FOTA.pdf file describes this. You have to use an Flash storage system connected to the SPI port. It is in this document related to the Firmware Over The Air update process, but you can use it for anything else.

11 Why can’t I use the TC65 or/and AT commands when a program is launched?

The TC65 can act in two modes : Modem or software execution. In modem, it supports AT commands on any port (ASC0, ASC1, USB). In software execution mode, all the ports (ASC0, ASC1, USB) can only be used for communications. In this mode, you execute AT commands within your software, using the ATCommand class.

12 Why is MES not working?

It’s very likely that is for one of these reasons :

  • You didn’t set a fixed baudrate (at+ipr=115200 for 115200 bps for instance)
  • The cable or the serial connector you use doesn’t permit to send the RS232 modem DTR and DSR signals.

13 Can I use a serial over USB converter?

Yes, but for transfers, you need MES to work. Your serial/USB converter must support the RTS, CTS, DSR, DTR, DCD signals. The Trendnet TU-S9 works fine.

14 I have the TC65 but my supplier didn’t give me the SDK. What should I do?

This happens a lot. Some suppliers don’t even know that the TC65 can be programmed in java. You can ask them (because they are the one supposed to give it) and if they don't have it or don't want to give it to you, you have to ask Cinterion to sign an NDA to access the SDK.

15 Can I make my developments on a Linux hosts?

Not officially but you can. Someone made a page on TC65 Development on a Linux host about this. I’ve never tested it thought. Ricardo also gave some programs and files to use MES on Linux on the javacint group files (I haven’t tested it).

16 What are the network protocols supported by the TC65?

  • In AT Commands : Socket, FTP, HTTP, POP3, SMTP
  • In Java environment : Socket, SSL, HTTP/HTTPS, UDP

If you need FTP, you can’t do it in java directly unless you implement the FTP protocol in your code.

17 How can we make the chip go in sleep mode?

For the chip to be able to sleep, you have to make all your threads die, sleep or wait for an I/O to be performed.

The chip really goes in sleep mode 30 seconds after everything is ready to make it sleep.

18 How can we save settings on the TC65?

The best way is to save your parameters in a file using a settings abstraction class. I’ve seen people saving parameters in the SIM Card, it’s very constrictive and you lose everything when you need to change the SIM card. I think this is totally useless.

19 How are we supposed to manage the life program’s lifecycle?

Behind the wheels, the JVM will load your jar file, uncompress id, load the main class, instantiate it and…

  • The midlets starts in the “startApp” method and it should let the “startApp” call end by creating a new thread.
  • When the “destroyApp” method is called by the system, you have 5 seconds to close everything and call notifyDestroyed. If you don’t, your program will quit and it will display a warning on the console.
  • The “pauseApp” method (and its “notifyPaused” linked method) are optionnal. In the TC65, I’ve never seen them being used. But I don’t know everything.

Keeping the program’s loop in the “startApp” method is wrong. It creates update problems because the destroyApp method is called when the startApp method is still running.

Letting the startApp method call finish is a good thing. Creating new threads is not a requirements, you could handle everything through URC and ATCommandListener.

20 The OTAP process is working fine but how can I remotely enable the AutoStart on brand new TC65 chips?

I haven’t figured this out yet. I’m not sure there is a solution. I personally built a little program that check for new TC65 chip presence on the serial ports and setup them.

This isn’t much of a problem thought because it's best to do an initial installation and testing of each chip.

21 How can I identify each chip?

You can identify each chip with the “AT+GSN” AT command. you can identify its SIM card with the the “AT+CIMI” AT command.

22 Is there any recommendation around the use of files with the TC65 flash memory storage?

The flash memory is approximately limited to 100 000 R/W cycles. But because of the wear leveling mechanism applied by the flash memory, we can consider the number of writes applicables as way more important. So it’s really a matter of appending more than replacing and leaving enough free space for the wear leveling to apply.

More details here.

23 Can we build TC65 programs with Windows Vista or Windows 7?

23.1 SDK version 1.100

Yes but the direct deployment to device and the debugging from the IDE are not possible. Use MES, JObexFTP or TC65SH and copy the compiled files to the device manually.

23.2 SDK version 2.004+

This SDK version is compatible with the x86 and x64 versions of Microsoft Windows XP, Vista, 7.

24 Java program starts with the chip, how can I disable it?

When autostart is enabled and the autostart delay is set to 0, you cannot disable the autostart by AT Command. You have to use the “Switch Autostart off” program given with the TC65 SDK.

As described in the File:Java UserGuide.pdf :

Using the graphical “autoexec_off.exe” tool: 1. Connect the module to the PC 2. Make sure, that the module is switched off 3. Start the “Autoexec_Off” program 4. Select the COM-Port 5. Press the “AutoExec Off” button

25 How can the TC65 switch on automatically as soon as it is powered?

It seems connecting the ignition input (IGT_IN) to the power input works. But the TC65 HW Description file says :

When the TC65i module is in Power-down mode or Charge-only mode, it can be started to Normal mode or Airplane mode by driving the IGT (ignition) line to ground. This must be accomplished with an open drain/collector driver to avoid current flowing into this line.

26 How can we get the source code from a TC65 jar file?

Any java decompiler can do the trick.

27 How do we use I2C?

I2C java API only exists since TC65i. If you need some I2C using AT Command please read the AT Command doc.

The SDK documentation on that matter is pretty clear.

The documentation even has a pretty simple example, here it is with some comments added :

/*** Open I2C connection and data streams: ***/
 i2cConnection cc = (I2cBusConnection) Connector.open("i2c:0;baudrate=100"); // Bus 0 (there's only one on the TC65), 100 kbps
 int baudrate = cc.getBaudRate();
 InputStream inStream  = cc.openInputStream();
 OutputStream outStream = cc.openOutputStream();
/*** Write Transfer Frame, where a = message ID, AE = Slave Address and write request: ***/
 String data = "<aAE000102030405060708090A0B0C0E0F>";
 outStream.write(data.getBytes(), 0, data.length()); // This is acceptable here (because all these chars are ASCII), but you should avoid fixing the size of a byte array and a string (UTF8 chars can make 2 bytes).
Read response message: {a+} where a = message ID:
 byte[] inBuf = new byte[<size>];
 if (inStream.available())
  int inBufLen = inStream.read(inBuf);  // Here, the generated string is in : new String( inBuf, 0, inBufLen );
// But to get some real code, you have to do some standard InputStream processing
// It means basically that you have to wait for the '>' or '}' char ( == byte here) before handling each buffered packet.
 Note that the read method blocks the thread until at least one byte has been read.
 To avoid blocking infinitely in case the I2C bus does not respond, check please first
 if there is data available. If the bus sends a big amount of data, the data will be read
 in pieces and the implementation has to poll until the end of the data.
/*** Close data streams and connection: ***/

28 How can I protect my source code from being stolen and still distribute jar file?

Activate the compiler optimizations, and set the maximum obfuscation level.

29 Can we use an emulator for the TC65/TC65i?

No you can’t, sometimes it is referred to a simulator but in fact it always relies on the chip.

You should note that you could potentially emulate the chip by launching the midlet on a J2ME mobile device emulator and recreating all the Cinterion’s classes. But that wouldn’t be very interesting as most of the development work done on the TC65 is around the hardware handling.

30 How can I get and send back to a server the stack trace of an exception?

You can’t directly do it from the java code as the J2ME doesn’t allow to export the stack trace of an exception to an outputstream and you can’t change the defaults output streams (stdout and stderr). But you can set up your program to redirect it’s output to a logfile by using the “AT^SCFG=”Userware/Stdout” command described on page 65 of the TC65i AT Command Set document.

31 How can I use socket connection?

This is very well explained in the Connector class javadoc.

32 How can I send mail with the TC65?

As a general architecture pattern, it’s often more appropriate to use the server as an “alerter” that will send SMS, mail or anything else depending on the received messages. But still… You could use the mail AT commands but that will lead you to some very poor maintainability. If you’ve already handle some simple text protocol, it will be quite easy to communicate with the SMTP server. This is what it looks like : “<--" for received and "-->” for sent

<-- 220 ns301797.ovh.net ESMTP Postfix (Debian/GNU)
--> HELO TC65/toto
<-- 250 ns301797.ovh.net
--> MAIL FROM: <tc65@webingenia.com>
<-- 250 2.1.0 Ok
--> RCPT TO: <florent@clairambault.fr>
<-- 250 2.1.5 Ok
--> DATA
<-- 354 End data with <CR><LF>.<CR><LF>
--> From: <tc65@webingenia.com>
--> To: florent@clairambault.fr
--> Subject: This is a simple mail
--> Here is the content of the mail
--> .
<-- 250 2.0.0 Ok: queued as C3C323401B
--> QUIT
<-- 221 2.0.0 Bye

If you need to send attachments, this is a little bit more complex but not that much. You need to add some headers to send mail as multipart messages (meaning that it will contain more than one part). And you need to add some Base64 encoding method so that you could put the content of the file you wish to send into a base64 encoded format.

33 What can I do if I set a password on the device and forgot it?

Basically you can do everything that doesn’t require any password. Because there’s not way to recover your password. This is clearly stated in the Cinterion documentation:

CAUTION: Be careful not to lose the password. There is no way to reset or recover a forgotten password or to obtain a new password from the manufacturer.

Doing FOTA doesn’t seem possible and there isn’t any reported way to flash the NVRAM. So you basically bricked your device if the autostart delay was set to 0. If not, well, you should still put it in the trash bin because it will create some real constraints (like not being able to do some OTAP).

34 How can I enable autostart remotely ?

You can't. You have to do it using an USB or a serial connection.

35 How can I use the USB port in my java programs ?

You can't. You can just use it:

  • As a standard AT command modem
  • As a "System.out" output in your java programs
Personal tools