Comments (7)
probably fixed in the latest commit, please test.
from python-gsmmodem.
I was able to reproduce your issue inside unittest (based on provided responses). Probably your modem sends invalid time zone data (0x2C).
@fredyrommy What is your time zone? Should it be +10.5? Maybe +11?
from python-gsmmodem.
Maybe the negative sign is placed in the wrong nibble by the modem?
0x2C --> 0010 1100 -->
remove sign from the second nibble -0010 0100 = 0x24 negative * 0.25
= -9h timezone.
https://en.wikipedia.org/wiki/Binary-coded_decimal#Signed_variations
Maybe this bit just should be ignored, then it would mean +9h.
@fredyrommy please let us know your timezone :-) Is it -9 or +9?
from python-gsmmodem.
Currently time zone value is shifted back:
0xC2 --> 0x2C --> 0xC2 --> 0x42
And afterwards:
0x42 --> 42 * 15 / 60 --> -10h
Edit:
I just found that it was too late and I made a mistake:
tzHexVal = int((tzHexVal & 0x0F) * 0x10) + int((tzHexVal & 0x0F) / 0x10)
instead of:
tzHexVal = int((tzHexVal & 0x0F) * 0x10) + int((tzHexVal & 0xF0) / 0x10)
I will fix that (and add check for parsed value inside unit test) as soon as @fredyrommy will confirm time zone. 🙂
from python-gsmmodem.
According to the country code used inside your data (+62) it should be Indonesia, which has three time zones: +7, +8 and +9. Additionally, one of timestamps is decoded correctly by an old code (2016-10-30 04:59:44+07:00), so I assume it should be close to +7.
Values 0x2C and 0x28 have small difference, so I thought that someone forgot about BCD-check:
0x2C + 0x06 = 0x32 --> 32 * 15min / 1hr = +8
@fredyrommy Is it correct?
This hot fix could be found in a8b449d.
from python-gsmmodem.
yes my timezone is UTC +7 Jakarta, Indonesia
from python-gsmmodem.
@fredyrommy is your issue now resolved? (see #42; download v0.12 release or clone repo)
from python-gsmmodem.
Related Issues (20)
- Question: Support for modems with multiple SIMS ? HOT 1
- dial_polling_demo.py throws gsmmodem.exceptions.TimeoutException: ['NO CARRIER']
- TimeoutException with Sim800 module HOT 1
- Delivery Reports can't be disabled when in PDU mode HOT 2
- Modem working but having Timeout Exception HOT 3
- CMSError: CMS 321 HOT 3
- incompatibility with latest pyserial 3.5
- (removed - useless)
- Sms not receiving
- Support for RFC2217 (serial port over network)
- how best to extend? HOT 1
- Add an example to demonstrate the Sending SMS HOT 2
- Does not work on Python 3.x HOT 2
- Still Alive? HOT 5
- Question: support for windows? HOT 12
- Timeout exception raised for any command. HOT 16
- Error: 'GsmModem' object has no attribute 'rxThread' HOT 3
- sms_handler fails HOT 2
- Instant timeout exception
- PDU Decoding Error HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from python-gsmmodem.