First of all, thanks to everyone that spent sometime reading/answering my 
questions, I'm very pleased with that!

I found what was wrong... even if it is weird... btw, MaxX, you were right, 
the reading messages was crashing the program and after deleting it, it 
stopped crashing, but the incoming messages continued not being sensed.
By then I tried to replace my code with the original one, and remove the 
reading messages sentences, in an attempt to fix the sense of new incoming 
messages bug. When I fired the program it didn't crash... it sensed the 
incoming messages, it did everything OK! WOW, what could it be? well, I 
noticed that I forgot to change the Gateway parameters: SerialModemGateway 
gateway = new SerialModemGateway("modem.com4", "COM4", 115200, "Huawei", 
"E160"); that didn't made any sense since the modem is attached to COM6, 
but it worked great, I already tried different ports from 1 to 5, and only 
4 works fine.

Here is the screenshot <http://img62.imageshack.us/img62/8602/modemport.png>of 
the COM port used by the modem.

Is it a bug? Or am I doing something wrong?

Sexta-feira, 17 de Agosto de 2012 21:19:28 UTC+1, MaxX escreveu:
>
> I suspect that there is a problem with those messages there which are 
> stored in SR
> I suggest to comment the line where the message is printed out
>
>
> 116            msgList = new ArrayList<InboundMessage>();
> 117            Service.getInstance().readMessages(msgList, 
> MessageClasses.ALL);
> 118            for (InboundMessage msg : msgList) { 
> 119                System.out.println(msg); 
> 120            } 
>
> Because that's the point you application fails - at decoding the PDU
> Or even better try to delete those messages instead of printing them ;)
>
> But you have to do it for all memory locations ( you already figured out 
> how to do that :D )
>
>
> PS: line numbers are from your v4
>
>
>
>
>
>
> On Friday, August 17, 2012 2:12:44 PM UTC+3, Bruno Moreira wrote:
>>
>> Hi there,
>>
>> I tried it, and no error occurred, but I was unable to read the messages 
>> that are in memory(I had at least 3 messages unread, I think the Modem 
>> Dongle moves the messages from SIM to it's memory automatically, and that's 
>> why we can't reach them using SM Storage Location)
>> here is the Log of the test: http://pastebin.com/1Eezm3Qm
>>
>> My last post showed that it crashed right after trying to use "SR" 
>> storage location, which points to Delivery Reports. I tried using AT 
>> commands to delete all messages from all storage locations, but the 
>> problem persists.
>> During these researches I was able to find the available storage 
>> locations in my modem:  +CPMS: 
>> ("ME","MT","SM","SR"),("ME","MT","SM","SR"),("ME","MT","SM","SR")
>>
>> Since the problem seems to be the "SR" location I tried using "SMMEMT" 
>> string(I know MT would do it all, but I tried it already 
>> without satisfactory results), and the result was the same as using just 
>> "MT", it was able to read the messages already in memory, but couldn't 
>> sense the new incoming messages(I sent a new SMS with the text "Teste 7" by 
>> 12:05), here is the log with that test: http://pastebin.com/7B7dCCkq and 
>> the "Teste 7" message was not sensed.
>>
>> I believe that the fact I've set the StorageLocation prevented it from 
>> sensing new incoming messages, what can I do for it to sense it?
>>
>> Sexta-feira, 17 de Agosto de 2012 11:00:55 UTC+1, Thanasis escreveu:
>>
>>> Add again the following:
>>>  
>>> gateway.getATHandler().setStorageLocations("*SM*"); 
>>>  
>>> and try once more...
>>>
>>> On 17 August 2012 11:54, SMSLib Discussion Group on behalf of Bruno 
>>> Moreira <
>>> smslib+noreply-apn2wqe6zode8_fwbtjirjb7i2frwmulpffjei0y6hzy-h...@googlegroups.com
>>> > wrote:
>>>
>>>> Ok Lo4j is running.
>>>>
>>>> By the time I got this logs  http://pastebin.com/Dt64T9qv  I had 2 SMS 
>>>> in the inbox [test1] and [test2].
>>>> Also removed setStorageLocations():
>>>>
>>>> https://code.google.com/p/cr0vax-sms-lib/source/diff?spec=svn4&r=4&format=side&path=/trunk/SMSGateway/src/pt/ipbeja/estig/ReadMessages.java
>>>>  
>>>>
>>>> Quinta-feira, 16 de Agosto de 2012 20:41:24 UTC+1, MaxX escreveu:
>>>>>
>>>>> I copied that file into one of the directories which are in classpath 
>>>>> ... 
>>>>> An idea would be to copy it into the folder holding class files ( NOT 
>>>>> src files )
>>>>>
>>>>> I don't know how to configure Netbeans ...
>>>>>
>>>>> On Thursday, August 16, 2012 1:24:12 PM UTC+3, Bruno Moreira wrote:
>>>>>>
>>>>>> I used setStorageLocation because I saw this discussion  
>>>>>> https://groups.google.com/**forum/?fromgroups#!searchin/**
>>>>>> smslib/String$20index$20out$**20of$20range$20/smslib/7QL_**
>>>>>> NPigsw4/AMrey1ugp6QJ%5B1-25%5D<https://groups.google.com/forum/?fromgroups#!searchin/smslib/String$20index$20out$20of$20range$20/smslib/7QL_NPigsw4/AMrey1ugp6QJ%5B1-25%5D>
>>>>>> ** 
>>>>>>
>>>>>> I was unable to get log4j working, I added the library to the project 
>>>>>> and placed log4j.properties(that came with the smslib-v3.5.2\misc\Log4j 
>>>>>> Sample Configuration) next to my src files, but I can't get rid of these 
>>>>>> messages:
>>>>>>
>>>>>> log4j:WARN No appenders could be found for logger (smslib).
>>>>>> log4j:WARN Please initialize the log4j system properly.
>>>>>> log4j:WARN See http://logging.apache.org/**
>>>>>> log4j/1.2/faq.html#noconfig<http://logging.apache.org/log4j/1.2/faq.html#noconfig>for
>>>>>>  more info.
>>>>>>
>>>>>>
>>>>>> As you told me I removed the getAtHandler().**setStorageLocations();, 
>>>>>> and added the delete sentences:
>>>>>> https://code.google.com/p/**cr0vax-sms-lib/source/browse/**
>>>>>> trunk/SMSGateway/src/pt/**ipbeja/estig/ReadMessages.java<https://code.google.com/p/cr0vax-sms-lib/source/browse/trunk/SMSGateway/src/pt/ipbeja/estig/ReadMessages.java>
>>>>>> ** 
>>>>>>
>>>>>> How can I put Log4j running properly?
>>>>>>
>>>>>> Quarta-feira, 15 de Agosto de 2012 18:24:44 UTC+1, MaxX escreveu:
>>>>>>>
>>>>>>> Can you also post the  log4j log file  smslib.log  ?
>>>>>>>
>>>>>>> first step I would suggest to get rid of the gateway.getATHandler().
>>>>>>> set**StorageLocations(); 
>>>>>>>
>>>>>>> there is a SMSLib-AsyncMessageProcessor  thread which takes care of 
>>>>>>> reading messages from time to time and reads from all memory locations
>>>>>>> something like 
>>>>>>>
>>>>>>>  08-15-20:10:55,450 [SMSLib-AsyncMessageProcessor : 
>>>>>>> Modem./dev/ttyUSB1] DEBUG org.smslib.modem.AModemDriver  - GTW: 
>>>>>>> Modem./dev/ttyUSB1: SEND :AT+CPMS="SM"(cr)
>>>>>>> 08-15-20:10:55,651 [SMSLib-AsyncMessageProcessor : 
>>>>>>> Modem./dev/ttyUSB1] DEBUG org.smslib.modem.AModemDriver  - GTW: 
>>>>>>> Modem./dev/ttyUSB1: RECV :+CPMS: 0,40,0,40,0,40(cr)OK(cr)
>>>>>>> 08-15-20:10:55,651 [SMSLib-AsyncMessageProcessor : 
>>>>>>> Modem./dev/ttyUSB1] DEBUG org.smslib.modem.AModemDriver  - GTW: 
>>>>>>> Modem./dev/ttyUSB1: SEND :AT+CMGL=4(cr)
>>>>>>> 08-15-20:10:55,851 [SMSLib-AsyncMessageProcessor : 
>>>>>>> Modem./dev/ttyUSB1] DEBUG org.smslib.modem.AModemDriver  - GTW: 
>>>>>>> Modem./dev/ttyUSB1: RECV :OK(cr)
>>>>>>> 08-15-20:10:55,851 [SMSLib-AsyncMessageProcessor : 
>>>>>>> Modem./dev/ttyUSB1] DEBUG org.smslib.modem.AModemDriver  - GTW: 
>>>>>>> Modem./dev/ttyUSB1: SEND :AT+CPMS="ME"(cr)
>>>>>>> 08-15-20:10:56,052 [SMSLib-AsyncMessageProcessor : 
>>>>>>> Modem./dev/ttyUSB1] DEBUG org.smslib.modem.AModemDriver  - GTW: 
>>>>>>> Modem./dev/ttyUSB1: RECV :+CPMS: 0,99,0,40,0,40(cr)OK(cr)
>>>>>>> 08-15-20:10:56,052 [SMSLib-AsyncMessageProcessor : 
>>>>>>> Modem./dev/ttyUSB1] DEBUG org.smslib.modem.AModemDriver  - GTW: 
>>>>>>> Modem./dev/ttyUSB1: SEND :AT+CMGL=4(cr)
>>>>>>> 08-15-20:10:56,251 [SMSLib-AsyncMessageProcessor : 
>>>>>>> Modem./dev/ttyUSB1] DEBUG org.smslib.modem.AModemDriver  - GTW: 
>>>>>>> Modem./dev/ttyUSB1: RECV :OK(cr)
>>>>>>> 08-15-20:10:56,252 [SMSLib-AsyncMessageProcessor : 
>>>>>>> Modem./dev/ttyUSB1] DEBUG org.smslib.modem.AModemDriver  - GTW: 
>>>>>>> Modem./dev/ttyUSB1: SEND :AT+CPMS="BM"(cr)
>>>>>>> 08-15-20:10:56,453 [SMSLib-AsyncMessageProcessor : 
>>>>>>> Modem./dev/ttyUSB1] DEBUG org.smslib.modem.AModemDriver  - GTW: 
>>>>>>> Modem./dev/ttyUSB1: RECV :+CPMS: 0,20,0,40,0,40(cr)OK(cr)
>>>>>>> 08-15-20:10:56,453 [SMSLib-AsyncMessageProcessor : 
>>>>>>> Modem./dev/ttyUSB1] DEBUG org.smslib.modem.AModemDriver  - GTW: 
>>>>>>> Modem./dev/ttyUSB1: SEND :AT+CMGL=4(cr)
>>>>>>> 08-15-20:10:56,652 [SMSLib-AsyncMessageProcessor : 
>>>>>>> Modem./dev/ttyUSB1] DEBUG org.smslib.modem.AModemDriver  - GTW: 
>>>>>>> Modem./dev/ttyUSB1: RECV :OK(cr)
>>>>>>> 08-15-20:10:56,653 [SMSLib-AsyncMessageProcessor : 
>>>>>>> Modem./dev/ttyUSB1] DEBUG org.smslib.modem.AModemDriver  - GTW: 
>>>>>>> Modem./dev/ttyUSB1: SEND :AT+CPMS="SR"(cr)
>>>>>>> 08-15-20:10:56,854 [SMSLib-AsyncMessageProcessor : 
>>>>>>> Modem./dev/ttyUSB1] DEBUG org.smslib.modem.AModemDriver  - GTW: 
>>>>>>> Modem./dev/ttyUSB1: RECV :+CPMS: 0,40,0,40,0,40(cr)OK(cr)
>>>>>>> 08-15-20:10:56,854 [SMSLib-AsyncMessageProcessor : 
>>>>>>> Modem./dev/ttyUSB1] DEBUG org.smslib.modem.AModemDriver  - GTW: 
>>>>>>> Modem./dev/ttyUSB1: SEND :AT+CMGL=4(cr)
>>>>>>> 08-15-20:10:57,053 [SMSLib-AsyncMessageProcessor : 
>>>>>>> Modem./dev/ttyUSB1] DEBUG org.smslib.modem.AModemDriver  - GTW: 
>>>>>>> Modem./dev/ttyUSB1: RECV :OK(cr)
>>>>>>> 08-15-20:10:57,054 [SMSLib-AsyncMessageProcessor : 
>>>>>>> Modem./dev/ttyUSB1] DEBUG org.smslib.modem.ModemGateway  - GTW: 
>>>>>>> Modem./dev/ttyUSB1: CheckMpMsgList(): MAINLIST: 0
>>>>>>>
>>>>>>> Also I suggest to put inside the InboundNotification class the 
>>>>>>> following line 
>>>>>>> Service.getInstance().**deleteMessage(msg)
>>>>>>>
>>>>>>> like this
>>>>>>>
>>>>>>>     public class InboundNotification implements 
>>>>>>> IInboundMessageNotification {
>>>>>>>
>>>>>>>         public void process(AGateway gateway, MessageTypes msgType, 
>>>>>>> InboundMessage msg) {
>>>>>>>             if (msgType == MessageTypes.INBOUND) {
>>>>>>>                 System.out.println(">>> New Inbound message detected 
>>>>>>> from Gateway: " + gateway.getGatewayId());
>>>>>>>                 Service.getInstance().**deleteMessage(msg)
>>>>>>>
>>>>>>>             } else if (msgType == MessageTypes.STATUSREPORT) {
>>>>>>>                 System.out.println(">>> New Inbound Status Report 
>>>>>>> message detected from Gateway: " + gateway.getGatewayId());
>>>>>>>                 Service.getInstance().**deleteMessage(msg)
>>>>>>>
>>>>>>>             }
>>>>>>>         }
>>>>>>>     }
>>>>>>>
>>>>>>> On Wednesday, August 15, 2012 7:29:46 PM UTC+3, Bruno Moreira wrote:
>>>>>>>>
>>>>>>>> I'm almost sure that I have no messages to read! 
>>>>>>>>
>>>>>>>>    1. I attached the SIM Card to a phone and deleted them all!
>>>>>>>>    2. I used the Modem software to read/delete all messages
>>>>>>>>
>>>>>>>> After that I tried to play a bit with setStorageLocations, and if 
>>>>>>>> I use any of the following commands the error doesn't appear
>>>>>>>>             gateway.getATHandler().**setStorageLocations("SMME"); 
>>>>>>>>       // Sim Card Memory, Phone Memory, it can read old inbound 
>>>>>>>> messages, 
>>>>>>>> but can't read new inbound messages
>>>>>>>>             gateway.getATHandler().**setStorageLocations("SM");   
>>>>>>>>          // Sim Card Memory, Can't detect new inbound messages or read 
>>>>>>>> old 
>>>>>>>> ones
>>>>>>>>             gateway.getATHandler().**setStorageLocations("ME");   
>>>>>>>>          // Phone Memory, same as SMME
>>>>>>>>             gateway.getATHandler().**setStorageLocations("MT");   
>>>>>>>>          // Mututal, same as SMME
>>>>>>>> As I told in the code comments, it only appears to read messages 
>>>>>>>> using the phone memory, which appears that the ZTE Modem saves the 
>>>>>>>> messages 
>>>>>>>> in internal memory.
>>>>>>>>
>>>>>>>> But now I can't handle the new inbound messages, I started the 
>>>>>>>> ReadMessages and followed these steps:
>>>>>>>>
>>>>>>>>    1. saw the message Now Sleeping - Hit <enter> to stop service
>>>>>>>>    2. from my phone, Sent a SMS to the modem
>>>>>>>>    3. Saw a blue flashing light in the modem, indicating that the 
>>>>>>>>    SMS has arrived
>>>>>>>>    4. The program doesn't react... it should detect new inbound 
>>>>>>>>    messages(it did it already, when I was able to use ReadMessages 
>>>>>>>> program 
>>>>>>>>    without setting storage location)
>>>>>>>>
>>>>>>>> If I restart the program, I see all messages that I sent to the 
>>>>>>>> modem.
>>>>>>>> Any idea? what am I missing in order to read new inbound messages?
>>>>>>>>
>>>>>>>> here is my code: 
>>>>>>>> http://pastebin.com/**iUiDrbuD<http://pastebin.com/iUiDrbuD>
>>>>>>>>
>>>>>>>> Thanks
>>>>>>>> Bruno Moreira
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> I'm not sure if the ZTE modem has internal memory other then the 
>>>>>>>> SIM Card.
>>>>>>>>
>>>>>>>> Quarta-feira, 15 de Agosto de 2012 16:41:04 UTC+1, MaxX escreveu:
>>>>>>>>>
>>>>>>>>> what kind of message are you reading ? is it way too biig ?
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> On Saturday, August 4, 2012 10:15:32 PM UTC+3, Bruno Moreira wrote:
>>>>>>>>>>
>>>>>>>>>> I was able to run it properly, and it was running very 
>>>>>>>>>> well until now:
>>>>>>>>>> when I start the ReadMessage example it shows me this error: 
>>>>>>>>>> http://pastebin.com/**qxc0hs6F <http://pastebin.com/qxc0hs6F>
>>>>>>>>>> I've read that it is a non text message that causes the error, 
>>>>>>>>>> but I attached the SIM card to a mobile phone and deleted all 
>>>>>>>>>> messages and 
>>>>>>>>>> the problem persists.
>>>>>>>>>>
>>>>>>>>>> Any idea?
>>>>>>>>>>
>>>>>>>>>> Sexta-feira, 3 de Agosto de 2012 16:05:13 UTC+1, Bruno Moreira 
>>>>>>>>>> escreveu:
>>>>>>>>>>>
>>>>>>>>>>> Hi there,
>>>>>>>>>>>
>>>>>>>>>>> I've installed and imported the .jar library into NetBeans 7.01 
>>>>>>>>>>> libraries.
>>>>>>>>>>> Created a simple program: 
>>>>>>>>>>> http://paste.org/**52445<http://paste.org/52445>
>>>>>>>>>>> When I run it it displays this error: http://paste.org/52446
>>>>>>>>>>> I'm using a http://flavioblogg.blogspot.**
>>>>>>>>>>> pt/2008/12/modem-usb-3g-zte-**modelo-mf632-no-debian.html<http://flavioblogg.blogspot.pt/2008/12/modem-usb-3g-zte-modelo-mf632-no-debian.html>
>>>>>>>>>>>
>>>>>>>>>>> What am I doing wrong?
>>>>>>>>>>>
>>>>>>>>>>  -- 
>>>> You received this message because you are subscribed to the Google 
>>>> Groups "SMSLib Discussion Group" group.
>>>> To post to this group, send email to [email protected].
>>>> To unsubscribe from this group, send email to 
>>>> [email protected].
>>>> To view this discussion on the web visit 
>>>> https://groups.google.com/d/msg/smslib/-/W0k25MLGaNAJ.
>>>> For more options, visit https://groups.google.com/groups/opt_out.
>>>>  
>>>>  
>>>>
>>>
>>>

-- 
You received this message because you are subscribed to the Google Groups 
"SMSLib Discussion Group" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msg/smslib/-/H1ZMQUJ8K4UJ.
For more options, visit https://groups.google.com/groups/opt_out.


  • [smslib] Re: Can't run ... SMSLib Discussion Group on behalf of MaxX
    • [smslib] Re: Can't... SMSLib Discussion Group on behalf of Bruno Moreira
      • [smslib] Re: C... SMSLib Discussion Group on behalf of MaxX
      • [smslib] Re: C... SMSLib Discussion Group on behalf of MaxX
        • [smslib] R... SMSLib Discussion Group on behalf of Bruno Moreira
          • [smsli... SMSLib Discussion Group on behalf of MaxX
            • [... SMSLib Discussion Group on behalf of Bruno Moreira
            • R... SMSLib Discussion Group on behalf of Thanasis
            • R... SMSLib Discussion Group on behalf of Bruno Moreira
            • R... SMSLib Discussion Group on behalf of MaxX
            • R... SMSLib Discussion Group on behalf of Bruno Moreira
            • R... SMSLib Discussion Group on behalf of Thanasis
            • R... SMSLib Discussion Group on behalf of Bruno Moreira
            • R... SMSLib Discussion Group on behalf of MaxX
            • R... SMSLib Discussion Group on behalf of Bruno Moreira

Reply via email to