Comments (6)
Are you getting anything at all? Perhaps the call is not working?
I am having a similar problem - I'm getting the data OK, but, VESC 3.56 is not adding the crc and terminating byte (3) on the end - if yours does this too, it's probably causing the VescUart.h to skip returning you the data?
from vescuartcontrol.
It's maybe due to a buffer overflow. Since the time where Vesc_id has been added to the serialization, the whole packet exceed 63 bytes (default Arduino buffer size).
3 solutions :
- Switch to COMM_GET_VALUES_SELECTIVE
- Increase buffer size (a bit a pain)
- Use @SolidGeek 's FW that empty the buffer as the data comes (thus never reach the limit.
In my opinion, solution #1 is the better because it'll stay the same command across the further version, no need to touch your code each time you update.
from vescuartcontrol.
I can get all the values to return using the example code but am not able to just pull rpm.
@gitcnd What is "crc"?
@Peemouse What is "COMM_GET_VALUES_SELECTIVE"? How can you use that to pull the rpm?
from vescuartcontrol.
Let me push my fork (which use this command) and you'll be good.
Or easier : use @SolidGeek 's library
from vescuartcontrol.
@gitcnd What is "crc"?
Data packets start with a code (2) to say how big the packet length will be (2 means 1 byte length), then a byte to say how long the packet will be, then the packet data itself [which usually begins with a byte to say what data it is - eg - 4 means a reply to COMM_GET_VALUES], then after the data a 2-byte error-checking number called a "CRC" (cyclic redundancy check) and end with a single byte 3. You probably don't see those things - they get removed for you when you use the packet.
@Peemouse What is "COMM_GET_VALUES_SELECTIVE"? How can you use that to pull the rpm?
It is the same as COMM_GET_VALUES except you get to list what things you want, and it returns only what you asked for, instead of everything.
RPM is bit number 7 (zero based), so setting the mask to 0x80 will return just RPM to you
What are you building? I'm writing a new full-featured remote controller - my code gets RPM fine (I'm not using other peoples libs, which is why I'm messing with crcs etc)
from vescuartcontrol.
@Peemouse - That definitely sounds like the problem... except I'm using interrupts to fetch serial data the instant it's available on my Arduino Pro-Mini 3.3v (8mhz atmega328p) into a 520-byte buffer, so I am somewhat puzzled that the problem could be on my side - it seems like a bug on the sending side - in the vesc firmware itself.
from vescuartcontrol.
Related Issues (20)
- 'fdevopen' was not declared in this scope HOT 2
- getting additional values with VescUart HOT 3
- Update for new VESC4 Firmware incl w/ Beta VESC-Tool HOT 6
- ToDo: Add Message Handling > 255 (starting with 3) HOT 10
- Debugging on a Arduino Nano
- Support fw 3.28 HOT 6
- Tester wanted HOT 14
- Arduino/libraries/VescUart/VescUart.h:45:21: fatal error: arduino.h: No such file or directory #include "arduino.h" HOT 3
- Warning converting to non-pointer type
- VescUartControl for Vesc tool working with Teensy 3.6 Error HOT 2
- Compatibility with Arduino Uno HOT 1
- Help appreciated for ESP32 HOT 2
- Getting "Failed to get data!" help? HOT 1
- Probably does not work with modern firmware HOT 11
- How to use COMM_FORWARD_CAN to send commands to slave VESC HOT 1
- HOW TO USE FUNCTION SETPOSITION (MOTOR CONTROL)
- An error occurred while uploading the sketch Invalid library found
- Changing maximum duty cycle
- Issue when trying ti initiate the VescUART class
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 vescuartcontrol.