Comments (10)
An exception stacktrace would be helpful :)
from mavlink.
Sorry, Ben. I edit message and add exception stack to it. But it didn't save.
Exception in thread "main" java.lang.IllegalStateException: Failed generate signature for packet
at io.dronefleet.mavlink.protocol.MavlinkPacket.sign(MavlinkPacket.java:298)
at io.dronefleet.mavlink.MavlinkConnection.send(MavlinkConnection.java:327)
at simpleMavlink.Main.main(Main.java:157)
Caused by: java.security.DigestException: Length must be at least 32 for SHA-256digests
at sun.security.provider.DigestBase.engineDigest(Unknown Source)
at java.security.MessageDigest$Delegate.engineDigest(Unknown Source)
at java.security.MessageDigest.digest(Unknown Source)
at io.dronefleet.mavlink.protocol.MavlinkPacket.sign(MavlinkPacket.java:290)
... 2 more
from mavlink.
I think you need to do a bunch more to set up the messages right? Like you are hitting a signing issue because you didn't set up the signatureConfiguration. I think there are other things you need to set up as well. Again, I just peaked at V2 so I didn't look into it too closely, but my understanding is that you need to do more with V2 than you would with V1 (just calling send()).
from mavlink.
You probably did some of this in the code you didn't provide that opens the connection. I see in the readme file that you need to set up the signing and other stuff in the following way (this is for sockets, were I am using serial, but it should be about the same). Do you do this?
MavlinkConnection connection = MavlinkConnection.builder(socket.getInputStream(), socket.getOutputStream())
// Dialects are associated to systems when a heartbeat is received. The heartbeat
// informs us of the autopilot of the device, which tells us which dialect
// that device adheres to.
.dialect(MavAutopilot.MAV_AUTOPILOT_GENERIC, new StandardDialect())
.dialect(MavAutopilot.MAV_AUTOPILOT_ARDUPILOTMEGA, new ArdupilotmegaDialect())
// When specifying signing configuration, every Mavlink2Message that is send
// through this connection will be signed. We will need to setup signing
// by sending Mavlink1 messages before we can communicate with Mavlink2 messages.
.signing(new SigningConfiguration(
0, // This is the initial timestamp for signing, We should only specify
// a value other than 0 if we do not trust that our system's clock is
// going to be calibrated prior to the connection. Generally, this value
// is loaded from persistence (where the last signature timestamp is stored)
1, // The signing link ID. Generally, this should be connection-bound. So if there
// is more than a single connection, each of them has to have a different value.
// Secret key, should be 36 bytes in length. The specification recommends using a
// SHA-256'd passphrase.
MessageDigest.getInstance("SHA-256")
.digest("my secret key".getBytes(StandardCharsets.UTF_8))
))
.build();
from mavlink.
Enlade, i copy example and after that add my code that you could see here in while loop
from mavlink.
The key in the example "my secret key" isn't 36 bytes in length. So, maybe try changing it to something that is 36 in length if you haven't done that already?
Not sure that I'm reading that right, but maybe it needs to be 32 bytes. Might as well try it.
from mavlink.
I am not sure. But i already try expand this string - my secret key.
It's not help.
from mavlink.
Hey, guys. Do you have any ideas? When i commend sing method call error disappeared.
from mavlink.
It looks like there's something else with signing that isn't right. If you can do without signing for a while then I'll be able to properly test and fix this within a couple of weeks.
from mavlink.
thanks, Ben. i am looking forward in update. If you need any help write me and good luck.
from mavlink.
Related Issues (20)
- No such file or directory #include "common/mavlink.h" HOT 4
- Battery voltage list causes a crash when adding it to the builder HOT 5
- newbie to Mavlink HOT 1
- unrecognized field type java.util.ArrayList HOT 1
- how to generate custom messages from xml
- How to send MAV_CMD?
- issue - MavlinkSerializationException - Message does not have a builder HOT 8
- Connect Demo for mav_server HOT 5
- Connection refused:connect HOT 1
- Unable to send Status text (Java) HOT 1
- How to send mission file or how to check vehicle status? HOT 1
- newbie question , sending values in java
- system not showing any result HOT 9
- Unable to send messages to Ardupilot SITL HOT 3
- I need to send and receive messages in java mavlink, but I can't. Can you send sample code please? HOT 1
- Implement MavCmd: MAV_CMD_DO_GIMBAL_MANAGER_CONFIGURE HOT 1
- Newb question: Parsing incoming mavlink2 messages HOT 2
- 我收到一串byte[]的消息
- Unable to get any kind of data from UDP connection. HOT 1
- MAVLink XML change to allow exponentiation operator in bitmask flag
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 mavlink.