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
 

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 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
 

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().
> setStorageLocations(); 
>
> 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
>>
>> 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
>>>> 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
>>>>> 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
>>>>>
>>>>> 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/-/KHyf1g8pfgcJ.
For more options, visit https://groups.google.com/groups/opt_out.


  • [smslib] Can't run it p... SMSLib Discussion Group on behalf of Bruno Moreira
    • [smslib] Re: Can't... SMSLib Discussion Group on behalf of Bruno Moreira
      • [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
          • [smsli... SMSLib Discussion Group on behalf of MaxX
            • [... SMSLib Discussion Group on behalf of Bruno Moreira
              • ... SMSLib Discussion Group on behalf of MaxX
                • ... SMSLib Discussion Group on behalf of Bruno Moreira
                • ... SMSLib Discussion Group on behalf of Thanasis
                • ... SMSLib Discussion Group on behalf of Bruno Moreira
                • ... SMSLib Discussion Group on behalf of MaxX
                • ... SMSLib Discussion Group on behalf of Bruno Moreira
                • ... SMSLib Discussion Group on behalf of Thanasis
                • ... SMSLib Discussion Group on behalf of Bruno Moreira
                • ... SMSLib Discussion Group on behalf of MaxX
                • ... SMSLib Discussion Group on behalf of Bruno Moreira

Reply via email to