KarlHlmgrn / crypto-oled

Crypto price graph for Steelseries Apex Pro/7/5 OLED display
MIT License
7 stars 0 forks source link

Unable to switch to another cryptocurrency on new version #5

Closed Avngl closed 2 years ago

Avngl commented 3 years ago

Hi Karl. Thank you for the rewrite.

I seem to have an issue switching to another cryptocurrency on the new version of the script. Tried it using the default configuration, and also tried it when i modified the configuration to switch between 2 cryptocurrencies.

The error message shown:


  File "C:\Users\Arvin Gill\AppData\Local\Programs\Python\Python310\lib\site-packages\keyboard\_generic.py", line 22, in invoke_handlers
    if handler(event):
  File "C:\Users\Arvin Gill\AppData\Local\Programs\Python\Python310\lib\site-packages\keyboard\__init__.py", line 474, in <lambda>
    return hook(lambda e: e.event_type == KEY_UP or callback(e), suppress=suppress)
  File "C:\Users\Arvin Gill\Downloads\oled\crypto-graphing.py", line 45, in keyhook
    xValues, yValues, graphImage, actualIndex, currentPrice, dailyPercent, timeStamps = getGraph(coinIndex)
  File "C:\Users\Arvin Gill\Downloads\oled\crypto-graphing.py", line 118, in getGraph
    fig.set_size_inches(1.28,0.4)
  File "C:\Users\Arvin Gill\AppData\Local\Programs\Python\Python310\lib\site-packages\matplotlib\figure.py", line 2647, in set_size_inches
    manager.resize(*(size * self.dpi / dpi_ratio).astype(int))
  File "C:\Users\Arvin Gill\AppData\Local\Programs\Python\Python310\lib\site-packages\matplotlib\backends\_backend_tk.py", line 448, in resize
    self.canvas._tkcanvas.configure(width=width, height=height)
  File "C:\Users\Arvin Gill\AppData\Local\Programs\Python\Python310\lib\tkinter\__init__.py", line 1675, in configure
    return self._configure('configure', cnf, kw)
  File "C:\Users\Arvin Gill\AppData\Local\Programs\Python\Python310\lib\tkinter\__init__.py", line 1665, in _configure
    self.tk.call(_flatten((self._w, cmd)) + self._options(cnf))
RuntimeError: main thread is not in main loop```
KarlHlmgrn commented 3 years ago

@Avngl This seems to be an issue with matplotlib, will look into it when I get an opportunity. Thank you for sticking with me through all this trouble!

KarlHlmgrn commented 2 years ago

@Avngl Sorry for not getting back to you. I haven't been able to recreate your issue, from the error stack I can only pick out matplotlib as the culprit. Are you still experiencing the issue?

Avngl commented 2 years ago

Hi @KarlHlmgrn I am still experiencing the issue.

What should I do to update / fix matplotlub?

KarlHlmgrn commented 2 years ago

@Avngl Finally able to fix it, as I suspected there was an issue with matplotlib. I changed the backend to use Agg instead of TkAgg. Hope you enjoy!