Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stuck on Waiting for motors list from controller #5

Open
rm2488 opened this issue Jan 7, 2023 · 5 comments
Open

Stuck on Waiting for motors list from controller #5

rm2488 opened this issue Jan 7, 2023 · 5 comments

Comments

@rm2488
Copy link

rm2488 commented Jan 7, 2023

Hello
I tried running the web app. I'm able to connect over serial and can see the telemetry data (default 4 values) streaming from the controller. It responds to the "?" queries that are generated at regular intervals with "M:Smotor".

Example:
➡️ 0.0000 0.0000 0.0002 -3.4340
⬅️ ?
➡️ M:Smotor
➡️ 0.0000 0.0000 0.0049 -3.4338

However, the interface remains stuck at "Waiting for motors list from controller". I have both monitoring and commander enabled, and I've tried all the varieties of verbose modes, but there's no change. I'm running it at 921600 baud with a 100 downsample.

Could you please help me out?

Thank you
Regards,
RM

@nanoparticle
Copy link

Hi, I'm trying to get this app working, and ran into the same exact issue. Quickly skimming the source code, it seems like this might be responsible for the problem:

const MOTOR_OUTPUT_REGEX = /^\?(\w):(.*)\r?$/;
The regex appears to be expecting a '?' in front of the motor id character, whereas the commander begins the line with the motor id and no question mark. Unfortunately I have no idea how to run this type of web app locally for testing, so this is about the best I can do.

@Copper280z
Copy link

I'm having this problem too. That regex is looking for the result of sending the command "?\r", which should be something like "M:motor\r".

This regex doesn't need to be changed, but I changed it to the following because it seems that allowing zero or one newlines is probably ok, and possibly more robust.
const MOTOR_OUTPUT_REGEX = /^?(\w):(.*)\r?\n?$/;

This regex change, a few lines lower, does fix the problem.
useSerialIntervalSender("?", 10000); to useSerialIntervalSender("?\r", 10000);

Now the app progresses to having found the motor and I can plot stuff. However it doesn't seem to auto populate the motion and PID parameters.

@CharlesMod
Copy link

Chiming in, I have this same issue as well. The motor list just never populates.

@der-knusprige
Copy link

Same here.

@rm2488
Copy link
Author

rm2488 commented Jul 3, 2023

Sorry for the late reply.

I reached the same conclusion after parsing the code. Not being familiar with the toolchain (I think it uses React), I could not patch the issue.
I went ahead and used this tool instead- SerialPlot (no affiliation, just a happy user). It can parse the incoming streams and plot them. You can write custom strings to send as commands as well.
You can find it here:
https://github.com/hyOzd/serialplot

As far as the webcontroller is concerned- I figured out later that works with the Dev release. After updating to SimpleFOC v2.3, the motor is now populated. There is still no controlling the motor though- it reads the parameter values, but never plots the graph. I am not sure whether it is setting all the targets correctly either.

For now I continue to rely on SerialPlot. I can attach my commands list if anyone wants them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants