Giter Site home page Giter Site logo

Comments (6)

gitcnd avatar gitcnd commented on September 12, 2024

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.

Peemouse avatar Peemouse commented on September 12, 2024

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 :

  1. Switch to COMM_GET_VALUES_SELECTIVE
  2. Increase buffer size (a bit a pain)
  3. 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.

pumpkinheadnick avatar pumpkinheadnick commented on September 12, 2024

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.

Peemouse avatar Peemouse commented on September 12, 2024

Let me push my fork (which use this command) and you'll be good.
Or easier : use @SolidGeek 's library

from vescuartcontrol.

gitcnd avatar gitcnd commented on September 12, 2024

@pumpkinheadnick

@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.

gitcnd avatar gitcnd commented on September 12, 2024

@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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.