You are here

UART communication

20 posts / 0 new
Last post
EthB
Offline
Last seen: 7 years 2 months ago
Joined: 2017-09-05 23:44
Posts: 1
UART communication

I just updated my 4.12 VESC to the new firmware to use the new VESC-tool with it. It works great.

However, on the old firware, i had an arduino getting data over the UART port through RollingGecko's VescUartControl library. As soon as i updated the VESC and reconfigured everything, i was no longer able to get data over the UART port. Is anyone aware of any changes that may cause this in the newer firmware? Perhaps a change in how the VESC sends data or a change in commands on the newer firmware.

I have made sure that both my arduino serial and the vesc are running on the same baud rate as well as having PPM+UART activated on the VESC. 

Any ideas or help would be appreciated or just a discussion on how communication with the VESC over the UART port works or may have changed.

Pimousse
Offline
Last seen: 10 months 4 days ago
VESC Original
Joined: 2017-05-24 12:15
Posts: 101

The new protocol is available on github.

You can also find a new version of Rollinggecko's library just by selecting "VESC 6" branch on github.

Enjoy !

futuredesign
Offline
Last seen: 5 years 12 months ago
Joined: 2017-09-09 00:41
Posts: 4

Hi, I have the same issus however just with nRF communication. Yesterday I updated to new vesc-tool and firmware and then my nRF communication stopped working. I tried looking at the commits on github however I can't figure out what changed to the protocol.

(Edit: I forgot to change the app to nRF, now everything works)

florr
Offline
Last seen: 5 years 4 months ago
Joined: 2017-09-05 20:37
Posts: 1

Hey!

I've also build an arduino remote using UART and nRF. I'm Using RollingGeckos library - everything works except VescUartSetNunchukValues.. If i'm using VescUartSetCurrent everything works fine..
Is there something to activate within the vesctool?

jorand
Offline
Last seen: 11 months 1 week ago
Joined: 2017-12-05 15:11
Posts: 1

Hi, 

I have the same issus. Did you find a solution?
I use the `VESC 6` branch. I also have a problem with writeAckPayload that does not send data.

Thanks

rollinggecko
Offline
Last seen: 6 years 10 months ago
Joined: 2017-12-07 23:17
Posts: 1

Please see my last comment here: https://github.com/RollingGecko/VescUartControl/issues/15

Problem is in my function

void VescUartSetNunchukValues(remotePackage& data, int num) {
	int32_t ind = 0;
	uint8_t payload[11];
	payload[ind++] = COMM_SET_CHUCK_DATA;
	payload[ind++] = data.valXJoy;
	payload[ind++] = data.valYJoy;
	buffer_append_bool(payload, data.valLowerButton, &ind);
	buffer_append_bool(payload, data.valUpperButton, &ind);
	//Acceleration Data. Not used, Int16 (2 byte)
	payload[ind++] = 0;
	payload[ind++] = 0;
	payload[ind++] = 0;
	payload[ind++] = 0;
	payload[ind++] = 0;
payload[ind++] = 0;

But that correspond with

case COMM_SET_CHUCK_DATA:
		ind = 0;
		chuck_d_tmp.js_x = data[ind++];
		chuck_d_tmp.js_y = data[ind++];
		chuck_d_tmp.bt_c = data[ind++];
		chuck_d_tmp.bt_z = data[ind++];
		chuck_d_tmp.acc_x = buffer_get_int16(data, &ind);
		chuck_d_tmp.acc_y = buffer_get_int16(data, &ind);
		chuck_d_tmp.acc_z = buffer_get_int16(data, &ind);
		app_nunchuk_update_output(&chuck_d_tmp);
break;

I've no idea where the problem is.

Roger Wolff
Offline
Last seen: 2 years 5 months ago
VESC Original
Joined: 2017-05-24 12:27
Posts: 202

Right!

Dillon
Offline
Last seen: 3 months 2 weeks ago
VESC Original
Joined: 2017-08-14 11:48
Posts: 34

I have been struggling to get communication from a processor I am programming to a VESC 6. I managed to get the code from Vedder's UART tutorial to compile and transmit data over serial. I cannot get the VESC to respond to any commands. Do I need a newer library or something?

Thanks!

ninjaka
Offline
Last seen: 4 years 2 months ago
Joined: 2017-09-12 13:44
Posts: 1

try to disconnect ppm wires

Benjamin is awesome)

mwd467
Offline
Last seen: 6 years 9 months ago
Joined: 2018-01-30 14:25
Posts: 6

Hey, I am trying to get this to work with a recent firmware update as well using a LCP1549 board talking to the VESC over UART with no luck.

I tried sending a 2 1 4 64 132 3  to get back bldc values but continually get no response. I send the same thing to an arduino slave to ensure I am transmitting fine and it works.

I’m using VESC Tool, HW 410 FW 3.34, app is set to UART and all baud rates are 115200.

I am hoping to get a response from the vesc before implementing the rest of the library, maybe there will be a similar solution. I only have TX RX and GND pins used.

Thanks

mwd467
Offline
Last seen: 6 years 9 months ago
Joined: 2018-01-30 14:25
Posts: 6

UPDATE: The VESC is transmitting and working through UART fine. There was/is an error with my nxp board on the rx buffer, an external serial monitor confirmed this. My previous post can be ingnored. Thx

Dillon
Offline
Last seen: 3 months 2 weeks ago
VESC Original
Joined: 2017-08-14 11:48
Posts: 34

Sorry for late response guys. It worked! Did not have UART on. Thought it was on PPM and UART, was just PPM lol. Didn't bother checking. Had to rewrite the whole thing but wowee is it easier to the second time around. Integrated the whole thing into my main file with a couple lines of copy paste from Vedder's site. Learned a lot just doing the tutorial! Thanks a bunch everyone!

stefcux
Offline
Last seen: 3 days 15 hours ago
VESC Free
Joined: 2018-04-27 09:19
Posts: 3

Hi, I am trying to get value from the master vesc to the arduino MEGA. The com is TX (vesc) to RX1 (arduino). Gnd is connected.

I tried sending a 2 1 4 64 132 3 0  to get back bldc values with the ino example but the reply is still “failed to get data”

I’m using VESC Tool 0.95, firmware 3.4, app is set to UART, PPM and UART, all baud rates are 115200.

The library installed is rollingGecko branch VESC 6.

may be the library is too old for the fw3.4.

thank you for your help

wdaehn
Offline
Last seen: 3 years 1 month ago
Joined: 2017-09-12 17:26
Posts: 65

---edit----

wdaehn
Offline
Last seen: 3 years 1 month ago
Joined: 2017-09-12 17:26
Posts: 65

Never mind, was a problem on my side.

wurghi
Offline
Last seen: 6 years 1 month ago
Joined: 2018-09-13 00:28
Posts: 7

stefcux did you get it to work? i'm stuck with the same situation

wurghi
Offline
Last seen: 6 years 1 month ago
Joined: 2018-09-13 00:28
Posts: 7

nvm, i think i got it with https://github.com/SolidGeek/VescUart

wurghi
Offline
Last seen: 6 years 1 month ago
Joined: 2018-09-13 00:28
Posts: 7

By the way for someone else who's stuck here. Dump the Nano and go for a Pro-Micro. It reads the UART Data just like the Mega does.
Only difference in code is you use Serial1 instead of Serial and you have to reset by hand while uploading!

wkt
Offline
Last seen: 5 years 9 months ago
Joined: 2018-03-27 18:23
Posts: 5

Hi guys, I have a problem related to this, I am trying to debug the connection between UART and a Bluetooth module and I connected directly the UART pins through a FTDI USB adapter to the pc. (of course TX-RX and RX-TX). The app is set to PPM and UART. Should I see something on the console on this port now or do I have to send some characters to get the VESC to send something back?

stefcux
Offline
Last seen: 3 days 15 hours ago
VESC Free
Joined: 2018-04-27 09:19
Posts: 3

Hi

it works fine with arduino pro mini, teensy 3.2 for the remote, and it works perfectly with arduino meda, due and teensy for the VESC uart communication.