Ajatt-Tools / anki.koplugin

KOReader plugin enabling Anki card generations for words looked up in the internal dictionary.
49 stars 6 forks source link

Cannot send notes to anki #9

Closed vojtam closed 1 year ago

vojtam commented 1 year ago

Hello everyone,

I am having problems with adding word notes to anki. I have set AnkiConnect per the instructions and I am able to connect to it. Reader_2023-08-26_134002

However, when I want to send note to anki, it always fails with timeout. Reader_2023-08-26_134043

Does anyone have any idea what might be the problem?

vojtam commented 1 year ago
{
    "apiKey": null,
    "apiLogPath": null,
    "ignoreOriginList": [],
    "webBindAddress": "0.0.0.0",
    "webBindPort": 8765,
    "webCorsOriginList": [
        "http://localhost"
    ]
}

my AnkiConnect config

nairyosangha commented 1 year ago

Your anki-connect settings are correct, you wouldn't have been able to do that curl request either otherwise. Assuming that you set the url in config.lua to http://192.168.0151:8765 this should work. Unless you configured it through the internal menu itself, then you have to check in the ereader what's being used (see https://github.com/Ajatt-Tools/anki.koplugin#configuration at the end).

timeout usually indicates that you're using the wrong IP. It's possible that you're hitting the timeout set here: https://github.com/Ajatt-Tools/anki.koplugin/blob/67a3b9e988e82ab0964e23893afe64b447e9d276/ankiconnect.lua#L33 But that seems unlikely, you could try setting it to a higher number than 1 and see if that helps

vojtam commented 1 year ago

I found out I made a mistake when editing the config.lua. It works now, thanks a lot! :heart: