Comments (8)
Should be fixed with version 2.2.1
from pyais.
@bgercken Thank you for bringing this up. I will look at this but as soon as time allows. But it might take a couple of days.
from pyais.
No hurry on my part. Thank you very much.
from pyais.
Could you provide me some example that led to this issue? I am not able to reproduce the described behavior.
from pyais.
Below is output for encoding the following data.
data: {'type': 5, 'repeat': 0, 'mmsi': '538008122', 'ais_version': 1, 'imo': 9500091, 'callsign': 'V7GS3', 'shipname': 'CLIPPER BAROLO', 'shiptype': 70, 'to_bow': 166, 'to_stern': 30, 'to_port': 22, 'to_starboard': 10, 'epfd': 1, 'month': 5, 'day': 16, 'hour': 0, 'minute': 30, 'draught': 6.6, 'destination': 'BALTIMORE', 'dte': 0}
sentence: !AIVDO,2,1,0,A,5815J>T2@uKeKLM?<00<hU10E:0858tht0000000DhNF:5H0N@PPC52CClQ@0,0*28 (81)
sentence: !AIVDO,2,2,0,A,0000000000,2*16 (30)
UPDATE: actually 81 is too long. When you append the NMEA terminator it exceeds the max sentence length.
from pyais.
I had closed this but it still appears to be an issue.
Updated test fails:
from pyais import encode_dict
data = {
'type': 5, 'repeat': 0, 'mmsi': '259725000', 'ais_version': 1, 'imo': 9103128, 'callsign': 'LAXP4',
'shipname': 'STAR HANSA', 'shiptype': 70, 'to_bow': 177, 'to_stern': 22, 'to_port': 17, 'to_starboard': 14,
'epfd': 1, 'month': 5, 'day': 20, 'hour': 6, 'minute': 0, 'draught': 7.4, 'destination': 'US BAL', 'dte': 0
}
# Maximum sentence length, including the $ and <CR><LF> is 82 bytes.
NMEA_MAX_LEN = 82
NMEA_TERMINATOR = "\r\n"
def test_encode_type5():
encoded = encode_dict(data)
for i in range(len(encoded)):
encoded[i] += NMEA_TERMINATOR
assert len(encoded[i]) <= NMEA_MAX_LEN
if __name__ == "__main__":
test_encode_type5()
from pyais.
Thank you. I am pretty sure that I forgot to include the final <LF>
terminator when calculating the total length of a message. I will fix this tomorrow.
from pyais.
You were right. The max payload length should be set to 60 and not 61. The docstring of the relevant method actually mentions this:
This method takes care of splitting large payloads (larger than 60 characters)
into multiple sentences. With a total of 80 maximum chars excluding end of line
per sentence, and 20 chars head + tail in the nmea 0183 carrier protocol, 60
chars remain for the actual payload.
But then the implementation sets max_len
to 61 (see).
from pyais.
Related Issues (20)
- [docs] messages.rst content duplicated. HOT 1
- PiPY out of date? HOT 1
- Stream from serial/COM port HOT 2
- lat lon converters float accuracy HOT 2
- AtoN codes do not match R0126 (A-126) Table 3 or M.1371-5 TABLE 74 HOT 1
- Provide decoding of communication status field in types 1, 2, 3, 4, 9, 11, 18 HOT 5
- pyais fails to decode type 5 messages HOT 6
- Message Type 26 Logic may be incorrect HOT 2
- MessageType24PartA : incorrect length? HOT 6
- EpfdType Enum Missing InternalGNSS = 15 HOT 2
- Navigational statuses 9, 10, 13 and Ship type 29 HOT 3
- NoneFilter broken HOT 1
- Get Country Code HOT 5
- TCPConnection stops receiving messages HOT 4
- Determination of the communication status field HOT 5
- Encoded NRZI data HOT 1
- Proposal for update HOT 5
- TypeError: 'dict' object is not callable HOT 2
- Gatehouse wrapper messages feature HOT 8
- Variable-width text fields processed as constant-width ones HOT 7
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 pyais.