OpenTX Companion simulator - no voltage readings

Help with any software/desktop related issues. e.g. companion9x, eePe, etc
Post Reply
User avatar
rcyoda
Posts: 34
Joined: Sat Mar 11, 2017 3:41 am
Country: Australia

OpenTX Companion simulator - no voltage readings

Post by rcyoda » Fri Jul 14, 2017 7:22 am

When using OpenTX Companion simulator (2.2, but same I have on 2.1) I cannot get voltages to work. I put some values into RxBt and A1 fields (respectively 5,20V and 8.40V), but in radio simulator I cannot get these values. In the same time I can get other values, like RSSI.

Image

Image

In fact even on first screen all voltages are shown as zero (grayed).

What am I doing wrong?

User avatar
Kilrah
Posts: 9671
Joined: Sat Feb 18, 2012 6:56 pm
Country: Switzerland

Re: OpenTX Companion simulator - no voltage readings

Post by Kilrah » Fri Jul 14, 2017 7:35 am

Because you have the ratio set to 0, you need to set it right in the sensor settings.

User avatar
rcyoda
Posts: 34
Joined: Sat Mar 11, 2017 3:41 am
Country: Australia

Re: OpenTX Companion simulator - no voltage readings

Post by rcyoda » Fri Jul 14, 2017 7:45 am

Thanks for your prompt answer Kilrah.

This is what I suspected in the beginning, but the ratio per default is set to 13.2...

Image

Any other idea?

User avatar
rcyoda
Posts: 34
Joined: Sat Mar 11, 2017 3:41 am
Country: Australia

Re: OpenTX Companion simulator - no voltage readings

Post by rcyoda » Fri Jul 14, 2017 9:15 am

I have installed Companion 2.2 on my second computer (Mac OS X, previous was PC with Windows) and got the same effect. So seems that it is repeatable, even cross platform. Anybody having similar issue?

jtaylor
Posts: 131
Joined: Fri Nov 01, 2013 1:31 am
Country: -
Location: Wexford (Pittsburgh), PA

Re: OpenTX Companion simulator - no voltage readings

Post by jtaylor » Fri Jul 14, 2017 3:13 pm

Are you using the simulator form within Companion or the standalone simulator? How are you creating the sensors, meaning are they sensors that were created by the radio or are you using the telemetry simulator to create them?

I'm guessing you are using the telemetry simulator to create the sensors by starting the telemetry simulator and then discover sensors in the radio simulator to create the sensors. If that is the case I can duplicate the problem. I will open an issue against openTX 2.2 for the problem I see and propose a fix. I'll post the URL to the issue after I create it so you can see if it fits the problem you are having.

Jim


jtaylor
Posts: 131
Joined: Fri Nov 01, 2013 1:31 am
Country: -
Location: Wexford (Pittsburgh), PA

Re: OpenTX Companion simulator - no voltage readings

Post by jtaylor » Fri Jul 14, 2017 4:22 pm

I have created issue 5090 https://github.com/opentx/opentx/issues/5090 on github for the problem I see. @rcyoda I don't have enough information about you problem to know if my proposed fix will correct your problem or not, but you can take a look at it and see what you think.

Jim

User avatar
rcyoda
Posts: 34
Joined: Sat Mar 11, 2017 3:41 am
Country: Australia

Re: OpenTX Companion simulator - no voltage readings

Post by rcyoda » Sat Jul 15, 2017 3:33 am

Hi Jim, I was testing it from within Companion, but today I had the same effect on standalone simulator.

Either way I was simply opening Telemetry Simulator window, enter some values into RxTX and A1 voltage fields, mark "Simulate", and then go to Radio Simulator, switch to telemetry page in radio window (using buttons, like on real radio) and hit "Discover new sensors" from there. Every time I got zero values on these sensors, while other - like RSSI or Cels - were working properly.

Good to know that it is actually kind of bug and thanks for creating an issue entry.

I'm not sure if I understood your proposed solution correctly. I thought that these fields are already editable (in Telemetry Simulator window) and its values should be simply passed to Radio Simulator, where they would update normally, like other sensors do. In other worst it seems that some values entered in Telemetry Windows are not actually passed to Radio Simulator. But obviously I do not have any insight knowledge how it works, so maybe it is not that easy...

User avatar
Kilrah
Posts: 9671
Joined: Sat Feb 18, 2012 6:56 pm
Country: Switzerland

Re: OpenTX Companion simulator - no voltage readings

Post by Kilrah » Sat Jul 15, 2017 8:35 am

It's not a bug. The simulator reads the existing settings from the eeprom when loaded and populates the telemetry simu ratio to match. There is no way for the telemetry simu to either read or set the ratio in the radio afterwards.

With the standalone simu if you do that (enable in simu and discover), once you close everything and reopen you'll have things working the way you want. In companion it's not possible.

User avatar
rcyoda
Posts: 34
Joined: Sat Mar 11, 2017 3:41 am
Country: Australia

Re: OpenTX Companion simulator - no voltage readings

Post by rcyoda » Sat Jul 15, 2017 1:09 pm

But why it is actually working for other sensors then? like RSSI or Cels?

User avatar
Kilrah
Posts: 9671
Joined: Sat Feb 18, 2012 6:56 pm
Country: Switzerland

Re: OpenTX Companion simulator - no voltage readings

Post by Kilrah » Sat Jul 15, 2017 1:23 pm

Becasue none of these depend on ratio, they're values with a meaning that is predetermined in the protocol.

The A1/A2 analogs however are legacy and have no meaning or definition of their own, they're just a unit-less number from 0 to 255 that could be anything. The ratio is needed to turn them into something useful to display. So the radio needs a ratio to know what to display when it receives 255, and in turn the telemetry simulator needs to know that ratio too so that it knows what value to send when you set it to say 9.6V, instead of requiring you to enter 185 (assuming default 13.2 ratio).

User avatar
rcyoda
Posts: 34
Joined: Sat Mar 11, 2017 3:41 am
Country: Australia

Re: OpenTX Companion simulator - no voltage readings

Post by rcyoda » Sat Jul 15, 2017 1:26 pm

Many thanks for this detailed explanation Kilrah.

I will check it with standalone simulator then.

User avatar
rcyoda
Posts: 34
Joined: Sat Mar 11, 2017 3:41 am
Country: Australia

Re: OpenTX Companion simulator - no voltage readings

Post by rcyoda » Wed Jul 19, 2017 11:46 am

Standalone simulator works on Windows. How to launch it on Mac OS X? I cannot find simulator executable...

User avatar
Kilrah
Posts: 9671
Joined: Sat Feb 18, 2012 6:56 pm
Country: Switzerland

Re: OpenTX Companion simulator - no voltage readings

Post by Kilrah » Wed Jul 19, 2017 6:05 pm

I don't think it's ever been part of the distribution on OSX for some reason.

User avatar
rcyoda
Posts: 34
Joined: Sat Mar 11, 2017 3:41 am
Country: Australia

Re: OpenTX Companion simulator - no voltage readings

Post by rcyoda » Wed Jul 19, 2017 10:47 pm

So is there any way to proper simulation of analog voltages on Mac OS X?

User avatar
Kilrah
Posts: 9671
Joined: Sat Feb 18, 2012 6:56 pm
Country: Switzerland

Re: OpenTX Companion simulator - no voltage readings

Post by Kilrah » Thu Jul 20, 2017 3:46 pm

Yes, set up your sensors in companion before launching the simulator...

Richard
Posts: 169
Joined: Sat Mar 29, 2014 10:44 pm
Country: United States
Location: Coral Springs, FL

Re: OpenTX Companion simulator - no voltage readings

Post by Richard » Wed Feb 07, 2018 9:13 pm

I read this thread, and it looks I have a slightly different issue also related to the voltages.
My problem is with the LiPo voltage sensor information.
The two values I cannot see in the simulation are Cels and Vmin. However, they work on the transmitter and also I can see both in the Log viewer.
I don't know if I am missing something but I would like to know which is the problem.
Attached is included clarification information.
Attachments
PC-9-01-2018-02-06-Session2.csv
(77.44 KiB) Downloaded 129 times
Richard

Richard
Posts: 169
Joined: Sat Mar 29, 2014 10:44 pm
Country: United States
Location: Coral Springs, FL

Re: OpenTX Companion simulator - no voltage readings

Post by Richard » Wed Feb 07, 2018 10:11 pm

missing pictures
Attachments
Session log.jpg
Telemetry settings.jpg
Telemetry simulation.jpg
Richard

jtaylor
Posts: 131
Joined: Fri Nov 01, 2013 1:31 am
Country: -
Location: Wexford (Pittsburgh), PA

Re: OpenTX Companion simulator - no voltage readings

Post by jtaylor » Thu Feb 08, 2018 12:06 am

The list of sensors in the telemetry simulator are not dynamically generated, meaning they are hard coded and not created from what is on the radio or in the log file. So since Vmin is not one of the provided simulated sensors you will not be able to simulate it or see it on log replay. Cels not updating in log replay looks like a bug in the simulator, however. Log replay reads the log header to match the log to the simulated sensors. For Cels it is looking for Cels(gRe) and your log has Cels(V) where V is the units (volt) and I have no idea what unit gRe is/was. If you open your log file in a text editor and change Cels(V) in the first line to Cels(gRe) you will see that log replay now updates Cels on log replay.

Jim

User avatar
Kilrah
Posts: 9671
Joined: Sat Feb 18, 2012 6:56 pm
Country: Switzerland

Re: OpenTX Companion simulator - no voltage readings

Post by Kilrah » Thu Feb 08, 2018 6:01 am

Cels not playing is normal. On the radio it is a "special" sensor containing 6 voltage values, but in the logs Cels is logged as the sum of those, the detail is lost.

jtaylor
Posts: 131
Joined: Fri Nov 01, 2013 1:31 am
Country: -
Location: Wexford (Pittsburgh), PA

Re: OpenTX Companion simulator - no voltage readings

Post by jtaylor » Thu Feb 08, 2018 11:40 am

Yes, but looking at the code it looks like the intent was to have log replay display the total cels value in the Cel1 position:

case CELS_GRE:
ui->cell1->setValue(columnData[info.dataIndex].toDouble());

However it is looking for Cels(gRe) in the log header instead of Cels(V):

colToFuncMap.insert("Cels(gRe)", CELS_GRE);

As I said changing Cels(V) to Cels(gRe) in the log header makes it replay the total voltage into the Cel1 1 position. I don't know if this ever worked or if the log header got changed somewhere and broke it. Adding a colToFuncMap.insert("Cels(V)", CELS_GRE); line would probably make it work as intended (or changing gRe to V). Actually the whole telemetry simulator would benefit from being redone to be dynamically created from model data if somebody with the ability had the time and inclination. Unfortunately I don't have the ability.

Jim

Richard
Posts: 169
Joined: Sat Mar 29, 2014 10:44 pm
Country: United States
Location: Coral Springs, FL

Re: OpenTX Companion simulator - no voltage readings

Post by Richard » Fri Feb 09, 2018 1:12 pm

I confirmed jtaylor's change to the log file header. I guess that was a miss when assigning units to Cels in the code.
Richard

Richard
Posts: 169
Joined: Sat Mar 29, 2014 10:44 pm
Country: United States
Location: Coral Springs, FL

Re: OpenTX Companion simulator - no voltage readings

Post by Richard » Fri Feb 09, 2018 1:20 pm

jtaylor, would you give me a link to the code, please?
Richard

jtaylor
Posts: 131
Joined: Fri Nov 01, 2013 1:31 am
Country: -
Location: Wexford (Pittsburgh), PA

Re: OpenTX Companion simulator - no voltage readings

Post by jtaylor » Fri Feb 09, 2018 8:31 pm

https://github.com/opentx/opentx
specifically https://github.com/opentx/opentx/blob/2 ... rysimu.cpp

I could submit a one line change to add colToFuncMap.insert("Cels(V)", CELS_GRE); to make it work the same way as editing the header does if it would be useful. Don't think anybody has ever complained so can't be used too much.

Jim

Richard
Posts: 169
Joined: Sat Mar 29, 2014 10:44 pm
Country: United States
Location: Coral Springs, FL

Re: OpenTX Companion simulator - no voltage readings

Post by Richard » Fri Feb 09, 2018 8:34 pm

Got you. Thank you for the link and suggestion.
Don't know if I will end up making the modification, but if I do, after testing I will let you know.
Richard

Post Reply

Return to “Software”