Gilles Gagnon replied to the topic 'INDI & Arduino' in the forum. 1 week ago

Hi Tom,

Moving forward with the Arduino code. I can set the relays to their correct states for opening and closing the roof, as well as the limit switched status. The remaining issue is to reset the relays to their inactivated states, i.e. NC. I am not sure where in the code I should put the "put relays to sleep" function. I tried where the limit switches are checked but no luck. I need to put that code in a place that gets executed 'often' and need to add a small delay, as the limit switched change state before the roof is fully opened or closed.

I have attached my adapted version of the rolloff.ini.standard code if it may help.

Thanks again,

Gilles

Read More...

Gilles Gagnon replied to the topic 'INDI & Arduino' in the forum. 1 week ago

Hi Tom, thanks for your reply.

I use a 'DIRECTION' as well as an 'ACTIVATION' relay to open or close the roof.

To open, I only activate the ACTIVATION relay as the NC position of the DIRECTION relay wires the power of the linear actuators (I have 2) to extend. To close, the DIRECTION relay is activated prior to the ACTIVATION relay, to reverse the polarity of the actuators, thus retracting it. The actuators have limit switched to turn them off when the end-of-course is attained but I do not have access to those. I know that the roof is opened or closed when the respective roof limit switches are set to ground (pull-up used) but the Arduino code needs to wait a few more seconds as the roof hits the limit switches before being fully opened or fully closed. The opening and closing functions are blocking so I can't really issue an abort or stop command unless I make some changes that may be a bit more complex. I hope my explanations are clear, if not do not hesitate to let me know.

To sumarize:
Open: DIRECTION relay OFF, ACTIVATION relay ON
Close: DIRECTION relay ON, ACTIVATION relay ON
Abort: ACTIVATION relay OFF

Is there a regular polling of the limit switches from the indi driver? If so, I can simplify my code and rely on the driver to know if the roof is fully opened or fully closed. That would simplify things.

Thanks for the help.
Gilles

Read More...

Gilles Gagnon replied to the topic 'INDI & Arduino' in the forum. 1 week ago

Hi Tom,

I just started following this post recently and found out that I could replace the python based "Dome Scripting Gateway" that I use with my "roll-off' with your rolloffino based driver.

My small, remote observatory uses a split roof on rails driven by linear actuators. To either open or close the roof, I need to activate two relays, one for direction that reverses the actuator polarity and the other to provide power. As your Arduino code uses one relay per roof function (one for opening, one for closing), I wonder if you would have any suggestions to implement two relays functions. I could modify the Arduino code so much to make it specific for my need but I ideally want to keep the code structure intact except for the specifics needed for my application.

Thanks for any help,

Gilles

Read More...

I just tried a real life polar alignment with the plate solving method using your suggested 'workaround', by setting an arcsecond-per-pixel value, instead of the arcminute width and the PA, and plate solving performed without any problem. I had "Refresh solver failed" errors before but not this time. Furthermore, the errors get updated correctly contrary to before where the errors would not always get updated and often not displayed.

Thanks.

William Optics GTF81 on Avalon M-Zero OBS
ZWO ASI1600MM Pro
ZWO ASI290MM (guide)
ODroid N2 running Ubuntu Mate 20.04 LTS
KStars 3.6.0 Beta

Read More...

The simplest way, for now, to return to the original start position, is to use the Direction button and go East if you were going West initially (and vice versa), and Start a new PA. I do that once in a while to verify and refine my PA, if needed.

It also happens to me, once in a while, that I mistakenly hit the Start button right after having performed a PA, somewhat frustrating but I always have the choice of not performing the adjustments if the PA is fine.

HTH

Read More...

Another nice alternative from the ODroid family is the C4 which has the same form factor as the RPi boards. Somewhat less powerful than the N2+ but still, enough to run KStars/EKOS/indi via NoMachine without trouble.

Read More...

Hi,

I also have an M-Zero OBS mount, with the polar alignment motors, and you can't use any of the indi supported drivers with them to perform PAA alt-az adjustment as they are not motors used in the sense of an alt-az driven mount (or eq driven mount) unfortunately.

I ended up building my own Teensy and TMC2209 based stepper controller with up/down/east/west buttons for those motors to perform the polar alignment adjustments as I did not like using the Avalon StarGo controller to do that through their hand controller, as it is cumbersome. I also ideally wanted to automate the PAA adjustment by taking the alt and az error values from the EKOS PAA routine and feeding them to a python script that would make the appropriate corrections to the mount elevation (latitude) and azimuth. Unfortunately again, from what I understand, those error values are not available outside EKOS, either through indilib or other mechanism. What I ended up doing then is get a 433Mhz remote (Amazon) with 4 relays and I connected the relays in parallel with the buttons of my stepper controller, that now allows me to perform the PAA routine from the comfort of my home, my observatory being a short distance outside.

You may want to look into a similar solution but I will follow this thread as any different idea may be interesting to consider.

Hope this helps,

Gilles

Read More...

Hi Wolfgang,

When I start indi from EKOS and the indiserver and indi Weather Radio are already running, indi asks me if I want to restart indiserver, to which I answer a resounding NO! So it keeps the indiserver and driver running from the indi-weatherradio.service.

Does wr_rrd_update.py uses the Weather Radio profile? I had thought yes at first but I am not so sure anymore even though it would make sense if it did since it contains the sensors info. If it does, where does wr_rrd_update.py and friends expect the profile to be saved. Mine is in /home/gilles/.indi/'Weather Radio_config.xml' and it may not be in the appropriate place.

Thanks again.

Read More...

Hello Wolfgang,

Well, its a little bit more obscure than what I thought.

After a fresh reboot, if I stop and restart the indi-weatherradio.service, /usr/share/weatherradio/bin/wr_rrd_update.py --verbose connects to the Weather Radio device and gives me only 0.000 weather values. If I start and then stop KStars/EKOS/indi with the Weather Radio driver I get expected weather values once I run /usr/share/weatherradio/bin/wr_rrd_update.py --verbose again. Makes me wonder if wr_rrd_update.py or what is in between wr_rd_update.py and the Weather Radio driver is missing some sensors or parameters configuration or initialisation, unless KStars and friends are run prior.

Currently running KStars 3.6.0 stable with indilib 1.9.7

Thanks

Read More...

Endlich, hurra!

After adding a print (result) statement in weatherradio.py I traced down the problem between the Indi Weather Radio driver and weatherradio.py as I was only getting 0.0000 as data values from the driver, via the indiserver. Trying something simplistic such as purging the xml configuration file of the driver and re-creating it again by saving the configuration, in KStars/EKOS/Indi, solved the data value problem. Yeah!

Now, on with the crontab to automate it.

Thanks for all the clues.

Read More...

Thanks Wolfgang,

Interestingly enough, the sensors.rrd file gets populated with valid data, interspersed with lines of "... -nan -nan -nan... -nan", so the sensor data is being read from the Weather Radio station. On the other hand the weather.rrd file only gets filled with either -nan or 0.0000000000e+00. Furthermore, even after a fair bit of time, the web page does not show any sensor data. Even though I installed the web interface according to the instructions provided and every file should be in the appropriate place, I will dig a little further in case of a problem on my part.

Read More...

Got a little further as far as making sure connections were established but, apart from what seems to be a time code since the web page display the correct time range, the json sensor data are all 0.0. Below is the indi-weatherradio.service restart and output from ./bin/wr_rrd_update.py --verbose; as well as some data from /usr/share/weatherradio/html/data/RTdata_6h.json.

gilles@MissionControl:/usr/share/weatherradio$ sudo systemctl restart indi-weatherradio.service
gilles@MissionControl:/usr/share/weatherradio$ ./bin/wr_rrd_update.py --verbose
Setting ethernet ip:port to 192.168.2.155:80
Waiting for connection...
Connection succeeded.
Setting location to lat=45.5, long=-75.75, elev=60.0.
Reading weather data from "Weather Radio"@192.168.2.245:7624
Reading weather parameter...
Reading weather parameter... (succeeded)
Reading sensor data from "Weather Radio"@192.168.2.245:7624
gilles@MissionControl:/usr/share/weatherradio$ ./bin/wr_rrd_fetch.py -s 6h
{
  "CloudCover":{
    "data":[
      [
        1661423100000.0,
        0.0
      ],
      [
        1661423400000.0,
        0.0
      ],
      [
        1661423700000.0,
        0.0
      ],
      [
        1661424000000.0,
        0.0
      ],
      [
        1661424300000.0,
        0.0
      ],
      [
        1661426100000.0,
        0.0
      ],
      [
        1661426400000.0,
        0.0
      ],
      [
        1661426700000.0,
        0.0
      ],
      [
        1661428500000.0,
        0.0
      ],
      [
        1661431200000.0,
        0.0
      ],
      [
        1661431500000.0,
        0.0
      ],
      [
        1661431800000.0,
        0.0
      ]
    ],
    "name":"CloudCover"
  },
  "DewPoint":{
    "data":[
      [
        1661423100000.0,
        0.0
      ],
      [
        1661423400000.0,
        0.0
      ],
...

If I go directly to http://192.168.2.155 I get the current Weather Radio.

Thanks again for any insight.

Read More...

Thanks Wolfgang,

I seem to have move forward as running wr_rrd_update.py with verbose gives me the following output, to which I added the print statement to confirm the connection:

Establishing connection SUCCEEDED to "Device:1"@192.168.2.245:7624
Reading weather data from "Weather Radio"@192.168.2.245:7624
Reading weather parameter...
Reading weather parameter... (succeeded)
Reading sensor data from "Weather Radio"@192.168.2.245:7624

My /etc/weatherradio.ini file is as follows:
#-----------------------------------------------------------------------
# Configuration file for weather radio.
#-----------------------------------------------------------------------

[WeatherRadio]
# INDI server delivering weather data
INDISERVER = 192.168.2.245
INDIPORT = 7624
# RRD storage holding time series data
RRDFILE = /usr/share/weatherradio/weather.rrd

# RRD storage holding time series for raw sensor data
RRDSENSORSFILE = /usr/share/weatherradio/sensors.rrd

# path to the JSON files holding the data
DATAPATH = /usr/share/weatherradio/html/data

# path to the directory holding web cam images and videos
MEDIADIR = /usr/share/weatherradio/html/media

#-----------------------------------------------------------------------
# configure INDI devices - create for each a separate section and
# let its name start with Device
#-----------------------------------------------------------------------
[Device:1]
# INDI device name
INDIDEVICE = Weather Radio
# INDI device connection mode: Ethernet or Serial
INDIDEVICEMODE = Ethernet
# INDI serial device port (only necessary for Serial mode)
###INDIDEVICEPORT = /dev/ttyUSB0
# INDI IP address (only necessary for Ethernet mode)
INDI_IP_ADDRESS = 192.168.2.155
# INDI IP port (only necessary for Ethernet mode)
INDI_IP_PORT = 80
# Geo Coordinates - Latitude (as decimal)
GEO_COORD_LAT = 45.5
# Geo Coordinates - Longitude (as decimal)
GEO_COORD_LONG = -75.75
# Geo Coordinates - Elevation (as decimal)
GEO_COORD_ELEV = 60.0

# [Device:2]
# INDIDEVICE = Rain Radio
# INDIDEVICEMODE = Serial
# INDIDEVICEPORT = /dev/ttyUSB0
# INDI_IP_ADDRESS = 172.28.4.42
# INDI_IP_PORT = 80
# GEO_COORD_LAT = 43.916876
# GEO_COORD_LONG = 5.716624
# GEO_COORD_ELEV = 650.0

What I am not sure of is that it's not clear that the script connects to the Weather Radio device @192.168.2.155 to get the weather and sensor data. The current weather data is not displayed on 192.168.2.245. I may be missing something trivial but I can't find it.

Thanks again for any help,

Gilles

Read More...