SerialWiFi class for the SHC


Jesco Topp
 

Hi.

I am building a SerialWiFi class for the SHC. I have a basic implementation working. The SHC connects to OnStep and correctly shows/updates RA/DEC. I am still missing the 5-way button for my SHC build (en-route from AliExpress) so I can't test and debug the full functionality. But from the looks of it it seems to work.

In the meantime, I have a question about two functions in the Sst4 class. I tried to reproduce the interface of the Sst4 class. But I have not implemented the peek() & paused() functions yet.

I am not sure if I really need them. I tried to find references to them in the code (e.g. LX200.cpp and the UserInterface.cpp), but there don't seem to be any. I think I don't need the paused() function - there's no timing logic in my code. For peek() I don't understand the purpose. It checks the next byte of the receiving data without advancing the receiving buffer.

I apologise if this sounds stupid. I don't do much programming.

Thanks, Jesco


IMG_1667.jpg


Howard Dutton
 

On Wed, Oct 6, 2021 at 06:10 PM, Jesco Topp wrote:
I am not sure if I really need them. I tried to find references to them in the code (e.g. LX200.cpp and the UserInterface.cpp), but there don't seem to be any. I think I don't need the paused() function - there's no timing logic in my code. For peek() I don't understand the purpose. It checks the next byte of the receiving data without advancing the receiving buffer.
Paused stops the associated h/w timer, should I need that.  It's not currently used and not something you would need.
Peek is there for completeness.  It's an unimplemented part of the underlying stream class and something one would expect to be present in the Arduino world.


Howard Dutton
 

On Wed, Oct 6, 2021 at 06:10 PM, Jesco Topp wrote:
I apologise if this sounds stupid. I don't do much programming.
Not a small thing to get something like this going though!  Good job.


Howard Dutton
 

I discounted this idea of a wireless SHC in the past but over the years I've changed my mind about it and think it's a good idea.

On an ESP32 OnStepX you should be able to connect directly and not even need the SWS or an ST4 port for that matter.

Thinking of those ESP32/CNC3 based OnSteps (who would do well to skip all the fancy options and just do a basic build in my opinion) will have a nice control option.

Now just figure out how to power that ESP32...

https://www.ebay.com/itm/182945986004?hash=item2a986e35d4:g:7hMAAOSwLx5ayxNJ


Drew 🔭📷🚴‍♂️
 

On Thu, Oct 7, 2021 at 05:56 AM, Howard Dutton wrote:
Now just figure out how to power that ESP32..
Already working on that part. I have several options in my possession. The 18650 battery option you referenced is too big, IMHO. There are much smaller USB chargers which use the flat pack Lipo batteries. Here are a couple.

https://www.ebay.com/itm/192744201570?epid=14026626426&hash=item2ce0731d62:g:7I4AAOSwlfNcArfF
https://www.ebay.com/itm/400985254449?hash=item5d5c956a31:g:jK0AAOxycmBSqtT7

I agree that OnStepX is the way to go for this.


Jesco Topp
 

Thank you, Howard!

I'll leave paused() and peek() at their pro-forma (empty) definition then. This means I am actually finished for now. I am a bit sad that I am still missing the [H] 5-way button - it's two weeks before it arrives. Right now my only confirmation that it works is that the RA/DEC display follows all my scope slews. I will post the code once I have it verified, unless somebody would appreciate to have it earlier.

The WiFi libraries take up quite some space on the flash. I had to disable three catalogues (Caldwell, Herschel, Collinder) to make it fit on the ESP32. That's a bit sad.

I plan to power my unit with 4x AA rechargeables for now connected to the ST4 port's 5V/GND with a butchered ST4 cable. AA batteries are available in abundance and spares are easy to obtain - even at night. A flatpack LiPo battery with USB charger would be awesome, though - much tidier and less bulky.

https://www.ebay.com/itm/382661886604?hash=item59186d028c:g:OjgAAOSwyUFcCsIY

Regards,
Jesco


Drew 🔭📷🚴‍♂️
 

On Thu, Oct 7, 2021 at 09:25 AM, Jesco Topp wrote:
The WiFi libraries take up quite some space on the flash. I had to disable three catalogues (Caldwell, Herschel, Collinder) to make it fit on the ESP32.
Try compiling with the "Large App, No OTA" memory partition. Not all variations of the ESP32 hardware implementations allow this, I use the "Node32s".

There was a thread, I think it was over in the Main group, on using a standard switch in place of the 5-way. This works fine since the direction motions are redundant.


Drew 🔭📷🚴‍♂️
 

You will also most likely need to erase the ESP32 fully. There seems to be a problem with changing partition schemes from the existing one. Unlike the ESP8266 this must be done with a separate utility. Look in the instructions for the BGC for instructions: https://onstep.groups.io/g/main/wiki/26762

I found the thread for installing one of the standard switches instead of the 5-way: https://onstep.groups.io/g/main/topic/85388656#36962


Khalid Baheyeldin
 

On Thu, Oct 7, 2021 at 05:56 AM, Howard Dutton wrote:
I discounted this idea of a wireless SHC in the past but over the years I've changed my mind about it and think it's a good idea.
I am in the same camp here.
The SHC is a nice thing to have: the tactile buttons/joystick beat the Android app with a touchscreen any day.

But, the cable is inconvenient, and adding an ST4 port to an OnStep board is not easy (e.g. S6, CNC3, MKS Gen-L).

If there is a WiFi SHC, I will definitely use it.
 
Thinking of those ESP32/CNC3 based OnSteps (who would do well to skip all the fancy options and just do a basic build in my opinion) will have a nice control option.
Also the S6 and the MKS Gen-L.

Now just figure out how to power that ESP32...
That will be the big limiter. If it can be overcome, say by having regular
rechargeable store-bought batteries that would last a whole night, then
recharge fully during daylight, then we have a winner.


Khalid Baheyeldin
 

On Thu, Oct 7, 2021 at 07:09 AM, Drew 🔭📷🚴‍♂️ wrote:
The 18650 battery option you referenced is too big, IMHO. There are much smaller USB chargers which use the flat pack Lipo batteries.
A better option is regular AA form factor rechargeables.

For example:
https://www.amazon.ca/Energizer-AAA-Battery-Charger-Batteries/dp/B00339NINQ/

That way, if you run out or forgot to charge them, then you can get regular AA
and continue with your session.


Khalid Baheyeldin
 

On Thu, Oct 7, 2021 at 09:25 AM, Jesco Topp wrote:
The WiFi libraries take up quite some space on the flash. I had to disable three catalogues (Caldwell, Herschel, Collinder) to make it fit on the ESP32. That's a bit sad.
Caldwell is not a big one. Not sure about Collinder.
Herschel is helpful.
But one big catalog that may not be broadly used is IC.
Can you free up enough space by disabling only the IC catalog?

Not a big deal, since the user can select which catalog using the Catalog.Config.h file.

I plan to power my unit with 4x AA rechargeables for now connected to the ST4 port's 5V/GND with a butchered ST4 cable. AA batteries are available in abundance and spares are easy to obtain - even at night.
Fully agree. 4 X AA is the way to go.

Thank you for all this work, and I really look forward for using such an SHC.


Howard Dutton
 

On Thu, Oct 7, 2021 at 12:09 PM, Khalid Baheyeldin wrote:
On Thu, Oct 7, 2021 at 09:25 AM, Jesco Topp wrote:
The WiFi libraries take up quite some space on the flash. I had to disable three catalogues (Caldwell, Herschel, Collinder) to make it fit on the ESP32. That's a bit sad.
Caldwell is not a big one. Not sure about Collinder.
Herschel is helpful.
But one big catalog that may not be broadly used is IC.
Can you free up enough space by disabling only the IC catalog?
I thought the same as Drew.  Just reconfigure the Partition Scheme, bet it'll all fit.


Khalid Baheyeldin
 

On Thu, Oct 7, 2021 at 03:17 PM, Howard Dutton wrote:
I thought the same as Drew.  Just reconfigure the Partition Scheme, bet it'll all fit.
The partition scheme is a far better approach, once it is tested and documented.


Jesco Topp
 

On Thu, Oct 7, 2021 at 06:56 AM, Drew 🔭📷🚴‍♂️ wrote:
Try compiling with the "Large App, No OTA" memory partition. Not all variations of the ESP32 hardware implementations allow this, I use the "Node32s".

There was a thread, I think it was over in the Main group, on using a standard switch in place of the 5-way. This works fine since the direction motions are redundant.
Indeed, "no ota" works like a charm. It's at 63% usage. I'll try out soldering a regular button onto the [H] position this weekend. I have a hot-glue gun. Your link helps a lot!

On Thu, Oct 7, 2021 at 12:09 PM, Khalid Baheyeldin wrote:
Fully agree. 4 X AA is the way to go.
A 4x AA battery pack is huge, unfortunately. It's wider than the SHC itself. I am not sure if it's possible to assemble it in a neat package with good physical usability. 4x AA is easy to get, but a Flatpack is probably a better all-in-one package. It can be recharged with a USB powerbank off-grid.


Howard Dutton
 

On Fri, Oct 8, 2021 at 12:10 AM, Jesco Topp wrote:
but a Flatpack is probably a better all-in-one package. It can be recharged with a USB powerbank off-grid.
That seems like a good idea to me, then you don't have to get into figuring out a case with battery access too.


Drew 🔭📷🚴‍♂️
 

On Fri, Oct 8, 2021 at 03:10 AM, Jesco Topp wrote:
a Flatpack is probably a better all-in-one package. It can be recharged with a USB powerbank off-grid.
Could you provide a link to one? The ones I am thinking of present their own design issues. Like most designs I think this will end up being a compromise with no clear winner.


Ken Hunter
 

Jesco...

Send me your address and I will get you a 5-way switch in the mail today.
They are available (1 or more) from Mouser as well.
gmail kb7hunter

On Fri, Oct 8, 2021 at 4:28 AM Drew 🔭📷🚴‍♂️ <drewbolce@...> wrote:
On Fri, Oct 8, 2021 at 03:10 AM, Jesco Topp wrote:
a Flatpack is probably a better all-in-one package. It can be recharged with a USB powerbank off-grid.
Could you provide a link to one? The ones I am thinking of present their own design issues. Like most designs I think this will end up being a compromise with no clear winner.


Khalid Baheyeldin
 

On Fri, Oct 8, 2021 at 03:10 AM, Jesco Topp wrote:
Indeed, "no ota" works like a charm.
Did you just select that option, and compile?
Or did you have to wipe flash first using a separate tool?

Fully agree. 4 X AA is the way to go.
A 4x AA battery pack is huge, unfortunately. It's wider than the SHC itself. I am not sure if it's possible to assemble it in a neat package with good physical usability. 4x AA is easy to get, but a Flatpack is probably a better all-in-one package. It can be recharged with a USB powerbank off-grid.
My concern is simple things like forgetting to charge the batteries.
If AA's are used, then it is a simple matter of buying alkaline ones from somewhere.
If not, then the SHC is useless for that night.

For the form factor issue for the 4 AA's can be overcome by arranging them like this

Instead of side by side like this:

+-+-
OOOO
OOOO
OOOO
-+-+
|  |

They could be in two pairs like this
+-
OO
OO
OO
- +
+-
OO
OO
OO
- +
||


Jesco Topp
 

Khalid, yes. Actually I added the flag to the PlatformIO.ini. Not sure if that makes a difference. ( I use PIO - I use trial and error a lot during programming and Arduino compile times are awfully slow).


Khalid Baheyeldin
 

The ESP32 (and the ESP8266) pull in an awful lot of code and compiles all
that, which makes it always take much more time than other platforms.
So that is not a surprise.

Once you are ready to release the board, please list the details of all the
compile options that you use. They will be crucial to others successfully
having a full functional untethered hand controller.