×

INDI Library v2.0.6 is Released (02 Feb 2024)

Bi-monthly release with minor bug fixes and improvements

Update port or baud rate

  • Posts: 311
  • Thank you received: 42

Replied by wotalota on topic Update port or baud rate

Looking at the other focusers, they all have #include "indifocuser.h" in their .h file so double check your .h file does that.
5 years 1 month ago #34757

Please Log in or Create an account to join the conversation.

  • Posts: 281
  • Thank you received: 29

Replied by Helge on topic Update port or baud rate

Thanks a lot for kind support. Actually, I have been implementing the developer environment, as per the tutorial. Also, I have been including the indifocuser.h file.

In the meantime, I have been able to compile by just defining “int PortFD” at the beginning of my code. But that does not seem to make sense, as the value of this variable is then 0. If I correctly understand, it needed to become “/dev/rfcomm1”

But I have no clou how to get there. I reckon it has to do with handshake and ack(). Unfortunately, the tutorials for developing drivers to not (yet) cover the establishing of a serial connection, which would be great to have! Just a humble wish... :-)
5 years 1 month ago #34776

Please Log in or Create an account to join the conversation.

  • Posts: 220
  • Thank you received: 27

Replied by PDB on topic Update port or baud rate

Do you have the latest versions of your files on your github account? I can have a look and try to solve this. (Weather is bad anywhay, noting else planned)

Rgrds,

Paul
5 years 1 month ago #34777

Please Log in or Create an account to join the conversation.

  • Posts: 281
  • Thank you received: 29

Replied by Helge on topic Update port or baud rate

Hi Paul, that sounds great! On github I have the version, before trying out the tty commands. On my laptop I have a version I used for my fruitless attempts, and probably I created a mess. I guess here I would waste your time.

If you were looking at line 623 (tic_focus.cpp), this the command (function call, function is at lines 102)I wanted to try replacing with „tty_write(PortFD, ...,...,...)“ - if you could give that a try, would be really grateful.

github.com/HelgeMK/TicFocuserBT/blob/master/tic_focus.cpp

Any other advice or comments are also appreciated!

Best, Helge
5 years 1 month ago #34778

Please Log in or Create an account to join the conversation.

  • Posts: 220
  • Thank you received: 27

Replied by PDB on topic Update port or baud rate

will have a look.

P.
The following user(s) said Thank You: Helge
5 years 1 month ago #34779

Please Log in or Create an account to join the conversation.

  • Posts: 220
  • Thank you received: 27

Replied by PDB on topic Update port or baud rate

Solved most of the problems :) Problems were in the function declarations (with incorrect parameters so virtual did not do the correct job). Will tidy the up the sources a bit and let you know were you can pick them up. You will need to check however if all the commands are sent correctly since command buffer had to be changed to char to make tty_write work.

P
The following user(s) said Thank You: Helge
5 years 1 month ago #34786
Attachments:

Please Log in or Create an account to join the conversation.

  • Posts: 281
  • Thank you received: 29

Replied by Helge on topic Update port or baud rate

This is amazing, thank you so much! Now I am really curious what the code will look like.

Best, Helge
5 years 1 month ago #34789

Please Log in or Create an account to join the conversation.

  • Posts: 220
  • Thank you received: 27

Replied by PDB on topic Update port or baud rate

Hi,

attached modified cpp and h file. Most of the functionality should be working but you will need to check against a real device. (Especially the commands send, these could be wrong due to the mods needed)

Good luck

Paul
5 years 1 month ago #34795
Attachments:

Please Log in or Create an account to join the conversation.

  • Posts: 281
  • Thank you received: 29

Replied by Helge on topic Update port or baud rate

Dear Paul, really appreciated. I just downloaded and compiled without any problems. Also, the driver immediately connects, faster than before. Just the motor is not moving, and I hope I will have some time tonight to analyze. You were already hinting, that the commands could be wrong, but why do you think they could be wrong?

BTW: the way I connected the BT module to the Tic controller is one-way only, i.e. I only send signals, but do not receive back (which so far there was no need). In case the new code needs to feedback anything from the controller, please let me know.

Thanks once again for dedicating your time to this!!

Helge
5 years 1 month ago #34833

Please Log in or Create an account to join the conversation.

  • Posts: 220
  • Thank you received: 27

Replied by PDB on topic Update port or baud rate

I had to change the command array from uint8 to char, so there might be a problem with the assignments of the values (at least there were some warnings) So for the commands you need to check is the values are still correct.

It would be nice to have feedback from the controller, but it should work without. Only thing that will happen is that from INDI you can send new commands while the motor is still running. After the move commands have been sent, position in indi is updated immediatelly and INDI assumes the controller is in the new position. (When there is feedback, this can be avoided)

Regards,

Paul
5 years 1 month ago #34838

Please Log in or Create an account to join the conversation.

  • Posts: 281
  • Thank you received: 29

Replied by Helge on topic Update port or baud rate

Hi Paul, I was just trying to figure out what is happening, so I added a few lines to the code at line 75 I squeezed in the following:

IDMessage(getDeviceName(), "Command 0 %d", command[0]);
IDMessage(getDeviceName(), "Command 1 %d", command[1]);
IDMessage(getDeviceName(), "Command 2 %d", command[2]);
IDMessage(getDeviceName(), "Command 3 %d", command[3]);
IDMessage(getDeviceName(), "Command 4 %d", command[4]);
IDMessage(getDeviceName(), "Command 5 %d", command[5]);

The log file is interesting and seems to confirm your doubts, see attached log file from time stamp 2019-02-10T20:52:15.932 onwards (to the end of the file). I first set steps to 100, then back to zero, then 400 and back to zero. The command[] should in hexa decimal be 0xE0, according to the User Guide (www.pololu.com/docs/0J71/9). But in the log I see -32. Maybe this is the char value of "0", as the term 0xE0 starts with 0 (???).

But how to resolve, as the tty_write command requires a char variable?
5 years 1 month ago #34871
Attachments:

Please Log in or Create an account to join the conversation.

  • Posts: 281
  • Thank you received: 29

Replied by Helge on topic Update port or baud rate

Sorry, just realized I have been fooling myself with %d for showing the content of the char command variable.

I am giving in for today! :-)
Last edit: 5 years 1 month ago by Helge.
5 years 1 month ago #34873

Please Log in or Create an account to join the conversation.

Time to create page: 1.053 seconds