Comments (3)
I'm not sure if I follow, did you check the examples and the README ?
You should just send a POST or use websocket.
from mavlink2rest.
Please, let me know if you have further problems.
from mavlink2rest.
i tried with post by message structure
const armData = {
"header": {
"system_id": 1,
"component_id": 1,
"sequence": 0
},
"message": {
"type": "COMMAND_LONG",
"param1": 1.0,
"param2": 0.0, "param3": 0.0, "param4": 0.0, "param5": 0.0, "param6": 0.0, "param7": 0.0,
"command": {
"type": "MAV_CMD_COMPONENT_ARM_DISARM"
},
"target_system": 1,
"target_component": 1,
"confirmation": 1
}
};
fetch('http://192.168.2.2:4777/mavlink', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(armData)
})
.then(() => {
console.log('Arm sent to server', armData);
})
.catch((error) => {
console.error('Error sending Arm to server:', error);
});
}
}
can i get any example of using websocket
from mavlink2rest.
Related Issues (20)
- Multiple Filters on Websocket HOT 2
- Unable to ARM the drone HOT 3
- tcp connection results in continuous resource temporarily unavailable errors
- Unable to change GPS_TYPE from 3D Fix to RTK Flaot
- Unable to change GPS_TYPE from 3D Fix to RTK Float HOT 3
- I got in trouble when I try to use MAV_CMD_DO_REPOSITION, always return MAV_RESULT_UNSUPPORTED HOT 2
- Connect to SITL HOT 10
- Example command doesn't work HOT 5
- Does STATUSTEXT Field available?
- Add link for docs
- make helper more friendly
- MAVLink2 payloads have trailing zeros HOT 1
- COMMAND_LONG HOT 1
- May I get some help with POSITION_TARGET_LOCAL_NED HOT 2
- [feature-request] Provide `.tlog` files for download
- Provide data from last API version on a non-versioned path HOT 1
- Compilation Error on M2 MacOS 14 HOT 3
- Send messages received from rest api and websocket to others websocket clients HOT 1
- Unable to receive data from mavproxy HOT 5
- M2R fails to receive some COMMAND_LONGS
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 mavlink2rest.