I don't work for NexDome but you should try to contact Tim , the author of the firmware. Either open an issue on the github repo ( https://github.com/nexdome/Firmware/issues ) or try emailing him may be. Have you tried contacting Nexdome directly also ?
Even though I have a Nexdome dome, I use my own controller and firmware on it, so I can't really help much more on the firmware issue.
Well, that was a bust. It solved the rotator issue of loosing sync, but now the shutter controller keeps crashing (requiring me to cycle its power on and off and closing it manually) and the rotator won't write my slave settings to EPROM. Either that - or the INDI driver is causing these issues.
I don't use INDI ... I'm 100% TheSkyX (on macOS for development and Linux in the dome)... and I don't use the Nexdome controllers or firmware ... I made my own controller and my own firmware (with my own X2 Plugin for TheSkyX :) ).
I would assume the new firmware is 100% compatible with the previous one so any driver should still work (I sure hope my X2 plugin for the Nexdome is still working ... which mean I'll probably have to test this new 4.x firmware).
Do you happen to have other versions of python installed ?!
if you just run /usr/bin/env python3 in the terminal, what version does it reports ?
Here is why I just tried and got no error on the import :
/usr/bin/python3 Python 3.8.2 (default, Nov 4 2020, 21:23:28) [Clang 12.0.0 (clang-1200.0.32.28)] on darwinType "help", "copyright", "credits" or "license" for more information.>>> import serial>>>
And tried to reinstall serial. I got this message.peterkennett@Peters-MacBook-Air ~ % sudo /usr/bin/pip3 install serial
Password:
WARNING: The directory '/Users/peterkennett/Library/Caches/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
WARNING: The directory '/Users/peterkennett/Library/Caches/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Requirement already satisfied: serial in /Library/Python/3.8/site-packages (0.0.97)
Requirement already satisfied: future>=0.17.1 in /Library/Python/3.8/site-packages (from serial) (0.18.2)
Requirement already satisfied: iso8601>=0.1.12 in /Library/Python/3.8/site-packages (from serial) (0.1.13)
Requirement already satisfied: pyyaml>=3.13 in /Library/Python/3.8/site-packages (from serial) (5.3.1)
WARNING: You are using pip version 19.2.3, however version 20.3.3 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
I'm about ready to give up. I'm back to the "ModuleNotFound" error again!peterkennett@Peters-MacBook-Air Downloads % prog_leonardo /dev/cu.usbmodem14101 Rotator-4.0.0.hex
Traceback (most recent call last):
File "/usr/local/bin/arduino_pro.py", line 6, in <module>
import serial
ModuleNotFoundError: No module named 'serial'
I have no idea why that syntax error did show up before, but now that I fixed it, the serial module is not working again! ARGHGHHH!
Here's the code again - and it all seems fine to me.
The PORT in the code is just a default if you don't pass the actual port on the command line so it doesn't quite matter as the whole function (prog_leonard) does pass the port.
Ok, I changed it to python3, and now I get a new error:peterkennett@Peters-MacBook-Air Downloads % prog_leonardo /dev/cu.usbmodem14101 Rotator-4.0.0.hex
Sadly, no change. I have serial installed (see above) and pyserial. Yet the special "reset" script keeps giving me an error that there is no module named "serial". I did try again to just run the prog_leonardo script, but it too failed as before:Connecting to programmer: .avrdude: butterfly_recv(): programmer is not responding
avrdude: butterfly_recv(): programmer is not responding
avrdude: butterfly_recv(): programmer is not responding
avrdude: butterfly_recv(): programmer is not responding
avrdude: butterfly_recv(): programmer is not responding
avrdude: butterfly_recv(): programmer is not responding
Found programmer: Id = "ǯP??"; type =
Software Version = .; Hardware Version = .
avrdude: butterfly_recv(): programmer is not responding
avrdude: error: buffered memory access not supported. Maybe it isn't
a butterfly/AVR109 but a AVR910 device?
avrdude: initialization failed, rc=-1
Double check connections and try again, or use -F to override
this check.
avrdude: error: programmer did not respond to command: leave prog mode
avrdude: error: programmer did not respond to command: exit bootloader
Building wheels for collected packages: pyyaml, future
Building wheel for pyyaml (setup.py) ... done
Created wheel for pyyaml: filename=PyYAML-5.3.1-cp38-cp38-macosx_10_14_6_x86_64.whl size=44627 sha256=49be702d3b4599bf2b222013be5bc452891c8b06362ba4a0ff7883cb82fe8146
Stored in directory: /Users/peterkennett/Library/Caches/pip/wheels/a7/c1/ea/cf5bd31012e735dc1dfea3131a2d5eae7978b251083d6247bd
Building wheel for future (setup.py) ... done
Created wheel for future: filename=future-0.18.2-cp38-none-any.whl size=491057 sha256=fda9e3851ea0edb87cabe1b958dee6c92bd9994dc9c9bcfe9106c265b0464af0
Stored in directory: /Users/peterkennett/Library/Caches/pip/wheels/8b/99/a0/81daf51dcd359a9377b110a8a886b3895921802d2fc1b2397e
Successfully built pyyaml future
Installing collected packages: pyyaml, iso8601, future, serial
On my Mac I have installed the Arduino IDE .. which is what my "it uses my Arduino avrdude and the python script is in my dev stuff" comment means.
Aka.. that how avrdude is installed for me. I also have a macports version of it installed and you could use this and change the path to avrdude and its default config.
I'm not a programmer - so your new function is too confusing for me. I don't know how your comment "it uses my Arduino avrdude and the python script is in my dev stuff" would translate to my system. I don't have "dev stuff" so all those file addresses won't on my Mac.
Ok, I'll give that a shot tonight. I jut came back from the observatory where I had a problem. My Mac wasn't recognizing the rotator or shutter at all. I checked in my system profile on the Mac and it wasn't showing any USB devices connected. ARGH!
I have the function in my .zshrc (or .bashrc depending on what version of macOS you're on) and it uses my Arduino avrdude and the python script is in my dev stuff (it would also work with avrdude installed via Brew or Macports).:
The just get the actual device on which the arduino show up ( /dev/cu.usbmodem144201 for in my case but this port will be different on yours depending on which usb port it's plugged in).
Then I call the function from zsh/bash from inside the directory where the firmware is :
Rodolphe, thanks for your help. I would like to use my Mac to install this. In the command "prog_leonardo /dev/ttyUSB0 Rotator-4.0.0.hex" I assume I need to have Rotator-4.0.0.hex saved somewhere special? Right now it's in my download folder. How do I point to that file in the above command?
Damn!
I don't work for NexDome but you should try to contact Tim , the author of the firmware. Either open an issue on the github repo ( https://github.com/nexdome/Firmware/issues ) or try emailing him may be. Have you tried contacting Nexdome directly also ?
Even though I have a Nexdome dome, I use my own controller and firmware on it, so I can't really help much more on the firmware issue.
Well, that was a bust. It solved the rotator issue of loosing sync, but now the shutter controller keeps crashing (requiring me to cycle its power on and off and closing it manually) and the rotator won't write my slave settings to EPROM. Either that - or the INDI driver is causing these issues.
I don't use INDI ... I'm 100% TheSkyX (on macOS for development and Linux in the dome)... and I don't use the Nexdome controllers or firmware ... I made my own controller and my own firmware (with my own X2 Plugin for TheSkyX :) ).
I would assume the new firmware is 100% compatible with the previous one so any driver should still work (I sure hope my X2 plugin for the Nexdome is still working ... which mean I'll probably have to test this new 4.x firmware).
Rodolphe, thank you so much for your help! I had success after downloading a new serial-usb driver from https://www.ftdichip.com/Drivers/VCP.htm
It worked!
Now I need to test it with the old INDI driver I have. Have you tested it with EKOS yet? Peter
avrdude: devcode selected: 0x44
avrdude: AVR device initialized and ready to accept instructions
Reading | ################################################## | 100% 0.00s
avrdude: Device signature = 0x1e9587 (probably m32u4)
avrdude: safemode: lfuse reads as FF
avrdude: safemode: hfuse reads as D8
avrdude: safemode: efuse reads as CB
avrdude: reading input file "Shutter-4.0.0.hex"
avrdude: writing flash (28586 bytes):
Writing | ################################################## | 100% 2.24s
avrdude: 28586 bytes of flash written
avrdude: verifying flash memory against Shutter-4.0.0.hex:
avrdude: load data flash data from input file Shutter-4.0.0.hex:
avrdude: input file Shutter-4.0.0.hex contains 28586 bytes
avrdude: reading on-chip flash data:
Reading | ################################################## | 100% 0.22s
avrdude: verifying ...
avrdude: 28586 bytes of flash verified
avrdude: safemode: lfuse reads as FF
avrdude: safemode: hfuse reads as D8
avrdude: safemode: efuse reads as CB
avrdude: safemode: Fuses OK (E:CB, H:D8, L:FF)
avrdude done. Thank you.
Could be.
Do I have to turn that board off and then back on again somehow? (battery disconnect?).
ok, so pyserial working .. checked :)
The shutter Arduino should show up the same way the rotator Arduino does...
So it's weird if it doesn't.
Now I need to figure out how to connect the shutter. I connected a USB cable directly to the shutter - but my Mac wouldn't recognize it. :(
WooHoo! 50% success! I got the rotator upgraded! I had to uninstall and then reinstall pyserial.
pip uninstall pyserial pip install pyserial
Do you happen to have other versions of python installed ?!
if you just run /usr/bin/env python3 in the terminal, what version does it reports ?
Here is why I just tried and got no error on the import :
/usr/bin/python3 Python 3.8.2 (default, Nov 4 2020, 21:23:28) [Clang 12.0.0 (clang-1200.0.32.28)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import serial >>>
can you try that ?
No luck. :( prog_leonardo /dev/cu.usbmodem14101 Rotator-4.0.0.hex Traceback (most recent call last):
File "/usr/local/bin/arduino_pro.py", line 6, in <module>
import serial
ModuleNotFoundError: No module named 'serial'
These are just warning and should not prevent you from installing the serial module. do not update pip or anything else.
You can delete the /Users/peterkennett/Library/Caches/pip to get rid of the warning on the directory owner.
Apparently it says that the module is already installed in /Library/Python/3.8/site-packages
Does the python script still complain about not finding serial ?
I just upgraded to OSX 10.15.7
And tried to reinstall serial. I got this message. peterkennett@Peters-MacBook-Air ~ % sudo /usr/bin/pip3 install serial
Password:
WARNING: The directory '/Users/peterkennett/Library/Caches/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
WARNING: The directory '/Users/peterkennett/Library/Caches/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Requirement already satisfied: serial in /Library/Python/3.8/site-packages (0.0.97)
Requirement already satisfied: future>=0.17.1 in /Library/Python/3.8/site-packages (from serial) (0.18.2)
Requirement already satisfied: iso8601>=0.1.12 in /Library/Python/3.8/site-packages (from serial) (0.1.13)
Requirement already satisfied: pyyaml>=3.13 in /Library/Python/3.8/site-packages (from serial) (5.3.1)
WARNING: You are using pip version 19.2.3, however version 20.3.3 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
peterkennett@Peters-MacBook-Air ~ %
No, I did not update the Mac. I will now.
Very strange as we installed the python serial module !
Did you update macOS ?
Can you try re-installing the python serial module ?
I'm about ready to give up. I'm back to the "ModuleNotFound" error again! peterkennett@Peters-MacBook-Air Downloads % prog_leonardo /dev/cu.usbmodem14101 Rotator-4.0.0.hex
Traceback (most recent call last):
File "/usr/local/bin/arduino_pro.py", line 6, in <module>
import serial
ModuleNotFoundError: No module named 'serial'
I have no idea why that syntax error did show up before, but now that I fixed it, the serial module is not working again! ARGHGHHH!
Here's the code again - and it all seems fine to me.
#!/usr/bin/env python3
import sys
import os
import random
import serial
import time
PORT = '/dev/cu.usbmodem14101'
def main():
if(len(sys.argv) >1):
serial_port = sys.argv[1]
else :
serial_port = PORT
# Arduino reset
ser = serial.Serial(serial_port, 1200, timeout=1)
ser.DTR=0
ser.close()
time.sleep(1)
while True:
try :
os.stat(serial_port)
break
except Exception as e:
time.sleep(1)
continue
return 0
if __name__ == "__main__":
sys.exit(main())
The PORT in the code is just a default if you don't pass the actual port on the command line so it doesn't quite matter as the whole function (prog_leonard) does pass the port.
Thanks! By the way, I changed the port address in your code to the USB address used by my system to the rotator. Was that appropriate?
Here it is :
#!/usr/bin/env python3 import sys import os import random import serial import time PORT = '/dev/cu.usbmodem1411' def main(): if(len(sys.argv) >1): serial_port = sys.argv[1] else : serial_port = PORT # Arduino reset ser = serial.Serial(serial_port, 1200, timeout=1) ser.DTR=0 ser.close() time.sleep(1) while True: try : os.stat(serial_port) break except Exception as e: time.sleep(1) continue return 0 if __name__ == "__main__": sys.exit(main())
Hum, let me fix the code to be proper python3 :)
Ok, I changed it to python3, and now I get a new error: peterkennett@Peters-MacBook-Air Downloads % prog_leonardo /dev/cu.usbmodem14101 Rotator-4.0.0.hex
File "/usr/local/bin/arduino_pro.py", line 27
except Exception, e:
^
SyntaxError: invalid syntax
----------------------------------
It seems it doesn't like the comma in your code.
Change this line in the script :
#!/usr/bin/env python2
to :
#!/usr/bin/env python3
as we used pip3 to install serial in python3 ... not python2
Sadly, no change. I have serial installed (see above) and pyserial. Yet the special "reset" script keeps giving me an error that there is no module named "serial". I did try again to just run the prog_leonardo script, but it too failed as before: Connecting to programmer: .avrdude: butterfly_recv(): programmer is not responding
avrdude: butterfly_recv(): programmer is not responding
avrdude: butterfly_recv(): programmer is not responding
avrdude: butterfly_recv(): programmer is not responding
avrdude: butterfly_recv(): programmer is not responding
avrdude: butterfly_recv(): programmer is not responding
Found programmer: Id = "ǯP??"; type =
Software Version = .; Hardware Version = .
avrdude: butterfly_recv(): programmer is not responding
avrdude: error: buffered memory access not supported. Maybe it isn't
a butterfly/AVR109 but a AVR910 device?
avrdude: initialization failed, rc=-1
Double check connections and try again, or use -F to override
this check.
avrdude: error: programmer did not respond to command: leave prog mode
avrdude: error: programmer did not respond to command: exit bootloader
And here: Collecting serial
Downloading https://files.pythonhosted.org/packages/1f/51/6a260c498162c37d0759f3759b7647a10d8d30caba1cfc9aa4b5b1f0d08b/serial-0.0.97-py2.py3-none-any.whl (40kB)
|████████████████████████████████| 40kB 461kB/s
Collecting pyyaml>=3.13 (from serial)
Downloading https://files.pythonhosted.org/packages/64/c2/b80047c7ac2478f9501676c988a5411ed5572f35d1beff9cae07d321512c/PyYAML-5.3.1.tar.gz (269kB)
|████████████████████████████████| 276kB 97kB/s
Collecting iso8601>=0.1.12 (from serial)
Downloading https://files.pythonhosted.org/packages/f5/c7/06b5938e79a09112a256f26a1ae0551b04bc6aafcb71fd7ee2390c2c54c6/iso8601-0.1.13-py2.py3-none-any.whl
Collecting future>=0.17.1 (from serial)
Downloading https://files.pythonhosted.org/packages/45/0b/38b06fd9b92dc2b68d58b75f900e97884c45bedd2ff83203d933cf5851c9/future-0.18.2.tar.gz (829kB)
|████████████████████████████████| 829kB 232kB/s
Building wheels for collected packages: pyyaml, future
Building wheel for pyyaml (setup.py) ... done
Created wheel for pyyaml: filename=PyYAML-5.3.1-cp38-cp38-macosx_10_14_6_x86_64.whl size=44627 sha256=49be702d3b4599bf2b222013be5bc452891c8b06362ba4a0ff7883cb82fe8146
Stored in directory: /Users/peterkennett/Library/Caches/pip/wheels/a7/c1/ea/cf5bd31012e735dc1dfea3131a2d5eae7978b251083d6247bd
Building wheel for future (setup.py) ... done
Created wheel for future: filename=future-0.18.2-cp38-none-any.whl size=491057 sha256=fda9e3851ea0edb87cabe1b958dee6c92bd9994dc9c9bcfe9106c265b0464af0
Stored in directory: /Users/peterkennett/Library/Caches/pip/wheels/8b/99/a0/81daf51dcd359a9377b110a8a886b3895921802d2fc1b2397e
Successfully built pyyaml future
Installing collected packages: pyyaml, iso8601, future, serial
Successfully installed future-0.18.2 iso8601-0.1.13 pyyaml-5.3.1 serial-0.0.97
Got it. pip3 install pyserial
Collecting pyserial
Downloading pyserial-3.5-py2.py3-none-any.whl (90 kB)
|████████████████████████████████| 90 kB 937 kB/s
Installing collected packages: pyserial
Successfully installed pyserial-3.5
You need to instal python serial library.. which is not simple if you're using the system python.
I'll need to see how to do that as I use macports.
Edit :
you might be able to do : sudo /usr/bin/pip3 install serial
And what does this mean: "Connecting to programmer: .avrdude: butterfly_recv(): programmer is not responding"
Ok, getting closer! I have the USB port working.
But when I run "rduino_pro.py" I get an error that there is no module named serial. peterkennett@Peters-Air bin % arduino_pro.py
Traceback (most recent call last):
File "/usr/local/bin/arduino_pro.py", line 6, in <module>
import serial
ImportError: No module named serial
10.15.6.
On my Mac I have installed the Arduino IDE .. which is what my "it uses my Arduino avrdude and the python script is in my dev stuff" comment means.
Aka.. that how avrdude is installed for me. I also have a macports version of it installed and you could use this and change the path to avrdude and its default config.
And are you all updated to 10.15.7 ? I think this was fixed in 10.15.4
I am using Catalina.
I'm not a programmer - so your new function is too confusing for me. I don't know how your comment "it uses my Arduino avrdude and the python script is in my dev stuff" would translate to my system. I don't have "dev stuff" so all those file addresses won't on my Mac.
This is weird. What version of macOS are you running as at some point there was an issue with Arduino on macOS on Catalina (which has been fixed).
And it works fine with Big Sur 11.1 (juts tested an arduino leonardo on mine).
Ok, I'll give that a shot tonight. I jut came back from the observatory where I had a problem. My Mac wasn't recognizing the rotator or shutter at all. I checked in my system profile on the Mac and it wasn't showing any USB devices connected. ARGH!
I have the function in my .zshrc (or .bashrc depending on what version of macOS you're on) and it uses my Arduino avrdude and the python script is in my dev stuff (it would also work with avrdude installed via Brew or Macports).:
prog_leonardo () { ~/src/Dev/python/arduino_pro.py $1 /Applications/Tools/Arduino.app/Contents/Java/hardware/tools/avr/bin/avrdude -C/Applications/Tools/Arduino.app/Contents/Java/hardware/tools/avr/etc/avrdude.conf -v -patmega32u4 -cavr109 -P$1 -b57600 -D -Uflash:w:$2:i }
you can download the firmware there :
The just get the actual device on which the arduino show up ( /dev/cu.usbmodem144201 for in my case but this port will be different on yours depending on which usb port it's plugged in).
Then I call the function from zsh/bash from inside the directory where the firmware is :
prog_leonardo /dev/cu.usbmodem144201 Rotator-4.0.0.hex
this will reset the arduino and flash the new version of the firmware.
Do the same thing for the shutter but with Shutter-4.0.0.hex
Rodolphe
Also - I used NANO to save that prog_leonardo function to my .bashrc_profile file. Is that correct?
Rodolphe, thanks for your help. I would like to use my Mac to install this. In the command "prog_leonardo /dev/ttyUSB0 Rotator-4.0.0.hex" I assume I need to have Rotator-4.0.0.hex saved somewhere special? Right now it's in my download folder. How do I point to that file in the above command?
the above also work on macOS (that's what I use .. as well as Linux ;) ).
Thanks! PS: I did get AVRdude installed and working on my Mac as well.
Linux is fine.
Install AVR Dude (apt install avrdude).
As the arduino need a special "reset" to get in the programing mode I wrote a small python script to do that.
#!/usr/bin/env python2 import sys import os import random import serial import time PORT = '/dev/cu.usbmodem1411' def main(): if(len(sys.argv) >1): serial_port = sys.argv[1] else : serial_port = PORT # Arduino reset ser = serial.Serial(serial_port, 1200, timeout=1) ser.DTR=0 ser.close() time.sleep(1) while True: try : os.stat(serial_port) break except Exception, e: time.sleep(1) continue return 0 if __name__ == "__main__": sys.exit(main())
save the above in /usr/local/bin as arduino_pro.py and make it executable (chmod a+x arduino_pro.py)
and a function in my .bashrc :
prog_leonardo () { /usr/local/bin/arduino_pro.py $1 avrdude -C/etc/avrdude.conf -v -patmega32u4 -cavr109 -P$1 -b57600 -D -Uflash:w:$2:i }
Then you call it :
prog_leonardo /dev/ttyUSB0 Rotator-3.3.0.hex
assuming your controller is on /dev/ttyUSB0 (change this to the proper port)
I run my dome via the INDI server on a Linux machine running Ubuntu 20.4. I also have a Mac OSX machine that I use to connect to the Linux box via VNC.
Yes, if you can get avrdude on the operating system you want to use to update the firmware and are comfortable running things from the command line.
So what operating system are you using ?