Closed code-SL closed 3 years ago
Found that byte recompiling the .emacs.d folder ended up resolving this issue.
Still can't get it to work due to an error message indicating the below message. Still feels like a WSL2 issue.
:ANKI_FAILURE_REASON: Error communicating with AnkiConnect using cURL: exited abnormally with code 7
Looks like this got complicated. WSL2 is effectively a VM, making localhost calls to win10 anki GUI not straightforward. You have to point emacs to the IP address of the windows machine defined in /etc/resolv.conf. Thus:
1) ensure that anki-connect's server in windows is accessible to any interface in order to accept connections from WSL2, 2) open the firewall for anki.exe, 3) set anki-editor listening address to be the address defined in resolv.conf in WSL2
Steps I followed to get it to work:
webBindAddress
variable to 0.0.0.0
to have the webBindPort
(default is 8765
) bind to any interfaceanki-editor-anki-connect-listening-address
to the nameserver ip in /etc/resolv.conf
, i.e. M-: (setq anki-editor-anki-connect-listening-address '{nameserver IP from /etc/resolv.conf})
(anki-editor-push-notes)
leads to "End of File while parsing JSON" error on WSL2 (windows 10) in Emacs 26.Request.el log (" request-log" buffer) is empty.
Tried on two different machines running WSL2 and coming up with the same issue. Can confirm that anki-connect is up. Can also confirm that .emacs configuration works for pushing notes in linux, so not sure if there is an issue with parsing JSON that is windows specific.