duino-coin icon indicating copy to clipboard operation
duino-coin copied to clipboard

PC_Miner.py and AVR_Miner.py issue - not working on Raspberry PI units - cannot use

Open ucra-fear opened this issue 5 years ago • 4 comments

Describe the bug After following the instructions from the Getting Started guide for installing on a Raspberry Pi, I get the following errors. I can get as far as inputting the username, selecting # of threads, difficulty, naming the rig and setting the donation level. Then it throws these errors. If I try to run the command again the same thing happens. I thought it may be because I had just upgraded my Raspberry Pi 4 8GB model to the new 64bit Bullseye release of Raspberry OS that was released on 10-31-21. Had the same issue on a Raspberry Pi 4GB model running the same OS. So then tried to do the clone of the repository on a Raspberry Pi Zero 2 W running the previous release Buster 32bit. Same error. I did a new flash of the Bullseye 32 bit version and tried it on the Raspberry Pi Zero 2 W and performed the install before anything else. It worked the first time, but had many connection issues. After a reboot I tried again and then it began giving the same error and will not mine anymore. It appears to be some kind of configuration error with the miner.greeting and color themes.

pi@RP4-01:~/duino-coin $ python3 PC_Miner.py Traceback (most recent call last): File "/home/pi/duino-coin/PC_Miner.py", line 834, in Miner.greeting() File "/home/pi/duino-coin/PC_Miner.py", line 403, in greeting print("\n" + Style.DIM + Fore.YELLOW + Settings.BLOCK + Fore.YELLOW File "/usr/lib/python3/dist-packages/colorama/ansitowin32.py", line 41, in write self.__convertor.write(text) File "/usr/lib/python3/dist-packages/colorama/ansitowin32.py", line 164, in write self.wrapped.write(text) UnicodeEncodeError: 'latin-1' codec can't encode character '\u2016' in position 11: ordinal not in range(256)

To Reproduce Steps to reproduce the behavior:

  1. Go to Duinocoin Getting Started Guide.
  2. Click on link to the section for installing / mining on a Raspberry Pi. Follow these steps as listed in the guide: do apt update && sudo apt upgrade -y # Update dependencies sudo apt install python3 python3-pip git # Install python3 and git git clone https://github.com/revoxhere/duino-coin # Clone the duino-coin repository cd duino-coin # Enter the duino-coin directory python3 PC_Miner.py # Launch the official miner
  3. Get the errors when trying to launch the miner.

Expected behavior After I input the info as stated above it should greet me, then connect to the servers and start mining. As stated above it worked fine on one machine as long as I installed the miner first thing on a fresh flash, but a reboot broke it. The previous version of the miner seemed to load fine but was receiving a lot of connection errors and large ping times. I was getting too many connection errors. I have tried to troublehoot my router and dns setttings but that does not seem to make a difference. I even took down my Pi-Hole Ad blocker for a week and it made no difference, so I turned the Pi-Hole back on. I do not think the Pi-Hole ad blocker would be the cause of this issue as I was able to connect and mine previously with the Pi-Hole in place. I could try whitelisting the Duinocoin server address on the Pi-Hole if need ISSUES_DUCO_Miner_2.74-5_11-21-21.txt be.

Screenshots/photos If applicable, add screenshots or photos to help explain your problem.

System (please complete the following information):

  • OS: Raspberry OS - Buster and Bullseye 32 and 64 bit.
  • Software PC_Miner.py
  • Version Release 2.7.4/2.7.5

Additional context Add any other context about the problem here.

ucra-fear avatar Nov 22 '21 03:11 ucra-fear

please let me know if I need to spin this part off into a separate issue:

I tried using the AVR_Miner.py on a Raspberry Pi 4 running 3 Raspberry Pi Picos and got a similar or same issue. It connected fine once but then didn't see the pico so I reflashed the pico and the miner detected all 3 as Raspberry Pi Pico.

Now when I try to run the AVR_Miner I get the following output right away. pi@RP400-8:~/duino-coin $ python3 AVR_Miner.py

00:20:28 net0 Searching for the fastest node to connect to 00:20:30 sys0 AVR mining thread is starting using DUCO-S1A algorithm (/dev/ttyACM0) 00:20:30 net0 Connected to master Duino-Coin server (v2.7) 00:20:30 sys1 AVR mining thread is starting using DUCO-S1A algorithm (/dev/ttyACM1) 00:20:31 net0 MOTD: You are mining on Bilapool, have fun! 00:20:31 sys2 AVR mining thread is starting using DUCO-S1A algorithm (/dev/ttyACM2) Exception in thread Thread-3: Traceback (most recent call last): File "/usr/lib/python3.9/threading.py", line 954, in _bootstrap_inner self.run() File "/usr/lib/python3.9/threading.py", line 892, in run self._target(*self._args, **self._kwargs) File "/home/pi/duino-coin/AVR_Miner.py", line 872, in mine_avr share_print(port_num(com), "reject", File "/home/pi/duino-coin/AVR_Miner.py", line 653, in share_print print(Fore.WHITE + datetime.now().strftime(Style.DIM + "%H:%M:%S ") File "/usr/lib/python3/dist-packages/colorama/ansitowin32.py", line 41, in write self.__convertor.write(text) File "/usr/lib/python3/dist-packages/colorama/ansitowin32.py", line 164, in write self.wrapped.write(text) File "/usr/lib/python3/dist-packages/colorama/ansitowin32.py", line 41, in write self.__convertor.write(text) File "/usr/lib/python3/dist-packages/colorama/ansitowin32.py", line 164, in write self.wrapped.write(text) UnicodeEncodeError: 'latin-1' codec can't encode character '\u26cf' in position 54: ordinal not in range(256) ^C00:20:35 sys0 SIGINT detected - Exiting gracefully. See you soon!

I edited the config file to turn on Debugging and got this output. pi@RP400-8:~/duino-coin $ python3 AVR_Miner.py 00:15:04.896264 DEBUG: Config file loaded

00:15:04.901157 DEBUG: Error displaying greeting message: 'latin-1' codec can't encode character '\u2016' in position 10: ordinal not in range(256) 00:15:04.901495 DEBUG: Starting donation process 00:15:04.906583 DEBUG: Error launching donation thread: 'latin-1' codec can't encode characters in position 83-84: ordinal not in range(256) 00:15:04 net0 Searching for the fastest node to connect to 00:15:05.326033 DEBUG: Fetched pool: bilapool-2 00:15:07.332352 DEBUG: Connecting to ('51.158.113.59', 6043) 00:15:07.332853 DEBUG: Connecting to ('51.158.113.59', 6043) 00:15:07.333120 DEBUG: Connecting to ('51.158.113.59', 6043) 00:15:07 net0 Connected to master Duino-Coin server (v2.7) 00:15:07 sys1 AVR mining thread is starting using DUCO-S1A algorithm (/dev/ttyACM1) 00:15:07.651268 DEBUG: /dev/ttyACM1: Requesting job 00:15:07 sys0 AVR mining thread is starting using DUCO-S1A algorithm (/dev/ttyACM0) 00:15:07.656853 DEBUG: /dev/ttyACM0: Requesting job 00:15:07 net0 MOTD: You are mining on Bilapool, have fun! 00:15:07 sys2 AVR mining thread is starting using DUCO-S1A algorithm (/dev/ttyACM2) 00:15:07.801592 DEBUG: /dev/ttyACM2: Requesting job 00:15:07.801819 DEBUG: /dev/ttyACM1: Received: e340d8c0d7915915d86bd7d5d43b3c1c85d71256 00:15:07.802646 DEBUG: /dev/ttyACM1: Sending job to the board 00:15:07.801976 DEBUG: /dev/ttyACM0: Received: e340d8c0d7915915d86bd7d5d43b3c1c85d71256 00:15:07.804136 DEBUG: /dev/ttyACM0: Sending job to the board 00:15:07.804868 DEBUG: /dev/ttyACM1: Reading result from the board 00:15:07.805048 DEBUG: /dev/ttyACM0: Reading result from the board 00:15:07.888045 DEBUG: /dev/ttyACM0: Result: 11011110 00:15:07.917504 DEBUG: /dev/ttyACM2: Received: fea555c58970d4dff5d40f033e22796e5cb355cc 00:15:07.917919 DEBUG: /dev/ttyACM2: Sending job to the board 00:15:07.918494 DEBUG: /dev/ttyACM2: Reading result from the board 00:15:07.919464 DEBUG: /dev/ttyACM1: Result: 100110111 00:15:07.973486 DEBUG: /dev/ttyACM2: Result: 10001100 00:15:08.000624 DEBUG: /dev/ttyACM0: retrieved feedback: BAD,Incorrect difficulty Exception in thread Thread-3: Traceback (most recent call last): File "/usr/lib/python3.9/threading.py", line 954, in _bootstrap_inner self.run() File "/usr/lib/python3.9/threading.py", line 892, in run self._target(*self._args, **self._kwargs) File "/home/pi/duino-coin/AVR_Miner.py", line 872, in mine_avr share_print(port_num(com), "reject", File "/home/pi/duino-coin/AVR_Miner.py", line 653, in share_print print(Fore.WHITE + datetime.now().strftime(Style.DIM + "%H:%M:%S ") File "/usr/lib/python3/dist-packages/colorama/ansitowin32.py", line 41, in write self.__convertor.write(text) File "/usr/lib/python3/dist-packages/colorama/ansitowin32.py", line 164, in write self.wrapped.write(text) File "/usr/lib/python3/dist-packages/colorama/ansitowin32.py", line 41, in write self.__convertor.write(text) File "/usr/lib/python3/dist-packages/colorama/ansitowin32.py", line 164, in write self.wrapped.write(text) UnicodeEncodeError: 'latin-1' codec can't encode character '\u26cf' in position 54: ordinal not in range(256) 00:15:08.043052 DEBUG: /dev/ttyACM1: retrieved feedback: BAD,Incorrect difficulty 00:15:08.086603 DEBUG: /dev/ttyACM2: retrieved feedback: BAD,Incorrect difficulty

ucra-fear avatar Nov 23 '21 05:11 ucra-fear

Which part is changing the codec supposed to fix? The PC_Miner.py issue or the AVR_Miner.py issue? JK Rolling already suggested I try " try insert this into the first line of AVR_Miner # -- coding: utf-8 -- " which didn't do anything.

ucra-fear avatar Nov 25 '21 00:11 ucra-fear

I am not finding a place in the raspi-config to set a codec. Where in Raspi-config is this usually set?

Edit: I found it! it is with the Keyboard settings. Changed it to utf-8 and that fixed the PC_Miner.py and AVR_Miner.py issues. As an FYI the new version of Raspberry Pi OS named Bullseye will set the keyboard to ISO9000 when the US Setting is chosen. It may be best to put a note in the Get Started document Raspberry Pi section to change it to utf-8.

Thank you for your help. I think this resolved the issue and it can now be closed.

ucra-fear avatar Nov 25 '21 00:11 ucra-fear

I stated it was in the Localization Keyboard section. When I looked again it is in the Localization Tab of Raspi Config, then the button for Localization, not Keyboard Settings.

On Thursday, November 25, 2021, 05:02:29 PM UTC, BastelPichi ***@***.***> wrote:  

Cool. We may add it to the getting started guid, good idea.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.

ucra-fear avatar Nov 26 '21 07:11 ucra-fear