Thread Tools
Oct 27, 2020, 03:24 PM
Registered User
No worries. Will update when I have some tests with the cameras.
Sign up now
to remove ads between posts
Oct 27, 2020, 03:39 PM
OlliW
Thread OP
does your ESP efforts imply that you could already successfully talk to the rx0 via a browser?
Oct 27, 2020, 03:43 PM
Registered User
Quote:
Originally Posted by OlliW
does your ESP efforts imply that you could already successfully talk to the rx0 via a browser?
I can connect it over wifi, but am unable to send any commands. This stays the same no matter what I connect to.
Oct 27, 2020, 03:56 PM
OlliW
Thread OP
"connect over wifi" means that on the PC you see it connected like you normally would see it for your router?
"unable to send commands" means that you enter a line in the browser and send it but the rx0 doesn't respond?
if this is two yes it might also be that you enter the wrong chars into the browser line ... since it's POST and not GET (if I remember correctly) and JSON the correct line might not be so easy, if sending a POST is possible at all that way ... never tried that ... might be that you need some app or tool ...
Oct 27, 2020, 05:35 PM
Registered User
Quote:
Originally Posted by OlliW



note that 120 would be a bit tough for roll

shouldn't be difficult form here on

you could have a look at the storm32 C code in betacopter: https://github.com/olliw42/ardupilot.../STorM32_lib.h.
You in fact just may use it
Maybe I actually should post it somewhere ...
Thank you for C code. But I couldn't write the code myself. For me, it's too complicated . I am to stupid to extract information from python script or mavlink protocol .
I was able to write arduino code for "hex to serial" and it worked. And then i writed arduino code for " floats to hex to serial" with sprintf function. The code had to work , but did not worked because i get e error from storm . .... I stuck here for long.
Oct 27, 2020, 05:42 PM
OlliW
Thread OP
it should be easy to use the storm32_lib.h with Arduino, you just need to include it with #include

to convert the floats to hex you MUST do typecasting, C usually does converting. i.e. when you do

uint32_t i;
float f = 1.0;
i = f;

when f is converted to int, yielding i = 1, but what you need to do is

i = (uint32_t)f;
Oct 27, 2020, 05:49 PM
OlliW
Thread OP
with the STorM32_lib.h it would be something like this

#include "STorM32_lib.h"
tSTorM32CmdSetAngles msg;
msg.pitch = 120.0;
msg.roll = 120.0;
msg.yaw = 120.0;
storm32_finalize_CmdSetAngles($msg);
Serial.write(&msg, sizeof(msg));

I haven't tested this, but it should give the idea. BTW, the STorM32_lib.h uses 0xF9 as start byte, so you wont get a response. If you want the response, you can change it to the normal 0xFA
Oct 27, 2020, 08:17 PM
Registered User
Quote:
Originally Posted by OlliW
"connect over wifi" means that on the PC you see it connected like you normally would see it for your router?
"unable to send commands" means that you enter a line in the browser and send it but the rx0 doesn't respond?
if this is two yes it might also be that you enter the wrong chars into the browser line ... since it's POST and not GET (if I remember correctly) and JSON the correct line might not be so easy, if sending a POST is possible at all that way ... never tried that ... might be that you need some app or tool ...
Here's a video of the issue https://youtu.be/I2tCU_J6SG0
Last edited by dgohstand; Oct 27, 2020 at 09:33 PM.
Oct 28, 2020, 01:41 AM
OlliW
Thread OP
your argument that flashing works and therefore the serial connection works is a FALLACY !!!as said, depending on the board (I couldn't see your's clearly enough to identify it) you may have together physically add a pullup to the RX or enable the pullup in software. With my ESP32 I had EXACTLY the same symptom, flashing worked but not my code. You may google Adafruit and Olliw, may yield a post where I raised it.
You can easily test it: Write a sketch which only mirrors, like loop(){ Serial.read(c); serial.write(c);} and send a char by putty, if you don't get it back you may have this issue.
Oct 28, 2020, 02:10 PM
Registered User
hi OlliW, i have compile error in the line storm32_finalize_CmdSetAngles($msg); . I changed $ to & and compile error went away. At least until that line. So we need $ or mayby &?
Oct 28, 2020, 02:14 PM
OlliW
Thread OP
& of course, type error ��
Oct 28, 2020, 03:23 PM
Registered User
Quote:
Originally Posted by OlliW
with the STorM32_lib.h it would be something like this

#include "STorM32_lib.h"
tSTorM32CmdSetAngles msg;
msg.pitch = 120.0;
msg.roll = 120.0;
msg.yaw = 120.0;
storm32_finalize_CmdSetAngles($msg);
Serial.write(&msg, sizeof(msg));

I haven't tested this, but it should give the idea. BTW, the STorM32_lib.h uses 0xF9 as start byte, so you wont get a response. If you want the response, you can change it to the normal 0xFA
I have error in the last line Serial.write(&msg, sizeof(msg));
Error is "no matching function for call to 'HardwareSerial::write(tSTorM32CmdSetAngles*, unsigned int)'"
i copied all error text in the txt file if you need to look.
Oct 28, 2020, 03:38 PM
OlliW
Thread OP
well, frankly, this was intended to give you the idea, not copy&paste ready code, i.e. basic C is demanded ... what the f do I know how Serial.write() is exactly defined ...
you have to typecast, maybe Serial.write((char*)&msg, sizeof(msg)); or Serial.write((uint8_t*)&msg, sizeof(msg)); or Serial.write((byte*)&msg, sizeof(msg));, or ... depending on how write(buf,len) is exactly defined (the Arduino help is shockingly useless)
Oct 28, 2020, 03:52 PM
Registered User
Quote:
Originally Posted by OlliW
as said, depending on the board (I couldn't see your's clearly enough to identify it) you may have together physically add a pullup to the RX or enable the pullup in software.
Ok. I'll try adding a physical pullup. You're talking about RX on the ESP? Not the computer Uart?

This is the ESP I'm using https://www.amazon.com/gp/product/B0...?ie=UTF8&psc=1
Oct 28, 2020, 04:16 PM
OlliW
Thread OP
yes, rx on the ESP needs to be pulled up, doing it in the code is the easiest: https://github.com/olliw42/goprohero...fi.ino#L42-L46
hm, the link points to about a dozen different boards ...


Quick Reply
Message:

Thread Tools

Similar Threads
Category Thread Thread Starter Forum Replies Last Post
Cool T-STorM32: The best STorM32 ever !? OlliW Multirotor Drone Talk 2 Feb 21, 2017 05:02 PM