Closed rbroen3rd closed 1 year ago
Okay. I'm going to focus back on creating a simple database with a design document before I tackle the connectivity problem.
Created a simple database "koi" and entered a document using cURL. Tried to create a design document with cURL and it failed for the same reason.
curl -X PUT http://admin:xxxxxxx@127.0.0.1:5984/koi/_design/ddoc -d '{"views":{"name":{"map":"function(doc) { emit(doc.name); }"}}}' -H'Content-Type:application/json'
{"error":"error","reason":"internal_server_error"}
Dang. Well I imagine that error might not appear with a docker install.
If you want to get your existing install to work, you could try looking for errors in couchdb's log file, but I don't know how to find them on a Mac install.
I'm about to abandon CouchDB and go the docker route.
Back to basics. Do the Pi and Mac talk to each other at all?
ping 192.168.1.64
PING 192.168.1.64 (192.168.1.64) 56(84) bytes of data.
64 bytes from 192.168.1.64: icmp_seq=1 ttl=64 time=0.260 ms
64 bytes from 192.168.1.64: icmp_seq=2 ttl=64 time=0.248 ms
64 bytes from 192.168.1.64: icmp_seq=3 ttl=64 time=0.246 ms
64 bytes from 192.168.1.64: icmp_seq=4 ttl=64 time=0.237 ms
64 bytes from 192.168.1.64: icmp_seq=5 ttl=64 time=0.230 ms
64 bytes from 192.168.1.64: icmp_seq=6 ttl=64 time=0.235 ms
64 bytes from 192.168.1.64: icmp_seq=7 ttl=64 time=0.236 ms
64 bytes from 192.168.1.64: icmp_seq=8 ttl=64 time=0.237 ms
64 bytes from 192.168.1.64: icmp_seq=9 ttl=64 time=0.285 ms
^C
--- 192.168.1.64 ping statistics ---
Can you confirm that running curl http://192.168.1.64:5984
on your pi will give you a response? Can I see your couchdb.json
file again? Honestly I would play with the timeout values. Maybe make them bigger or smaller. Note that call_timeout
should always be bigger than connection_timeout
.
Heck, try not specifying call_timeout
and connection_timeout
. By not specifying either of those you'll still get sensible defaults. I probably shouldn't have had you change them anyway.
Is your MATE program still uploading data to the database?
Sorry you weren't able to get CouchDB working with a native install. Good luck getting docker and or docker compose working with CouchDB. I can attempt to help out, but there are good docker resources out there for getting set up. It can be a learning curve if you end up going down a rabbit hole trying to understand what docker is and what everything is doing.
I have a new CouchDB instance installed. I have not been able to connect to it to setup SolarThing databases. I rand the cURL command and got the following:
curl http://192.168.1.64:5984
curl: (7) Failed to connect to 192.168.1.64 port 5984: Connection refused
rbrown3rd@bobspi01:/opt/solarthing/program/mate$ curl http://192.168.1.64:5984
I can ping my Mac from my Pi, so I imagine I have to go through the SolarThing setup again to enable that port? Here is my couchdb.json file:
{
"type": "couchdb",
"settings": {
"packet_upload": {
"throttle_factor": 3,
"initial_skip": 1
},
"command_download": {
"throttle_factor": 3,
"initial_skip": 4
}
},
"config": {
"protocol": "http",
"host": "192.168.1.64",
"port": 5984,
"username": "admin",
"password": "xxxxxx",
"connection_timeout": 5,
"call_timeout": 10
}
}
I notice that users had trouble with creating design documents in older versions of CouchDB. I didn't find any discussion about not being able to do that with newer versions, I'm running version 3.3.1 and have not done a new SolarThing setup on it yet. I created a simple database called Koi with one document in it containing 'name' and 'age' fields. I've not been able to create a design document for that database. That is where all paths seem to end up.
You should be able to add design documents with views before running SolarThing setup. SolarThing setup doesn't do anything special, it just automates adding the necessary design documents.
I have a new CouchDB instance installed. I have not been able to connect to it to setup SolarThing databases. I rand the cURL command and got the following:
curl http://192.168.1.64:5984 curl: (7) Failed to connect to 192.168.1.64 port 5984: Connection refused rbrown3rd@bobspi01:/opt/solarthing/program/mate$ curl http://192.168.1.64:5984
Alright, before you do anything with SolarThing, that curl command needs to be working. A few things, confirm that really is your Mac's IP address (make sure it stays static too). Also confirm that the bind address is 0.0.0.0
(https://docs.couchdb.org/en/stable/config/http.html#chttpd/bind_address). You can also try running this on your Mac: curl localhost:5984
to confirm that your Mac can see CouchDB.
For your native CouchDB install, I really have no idea how to get adding design documents working, and I don't think I can help you there. I'd be willing do do a tiny bit of research if you pasted your CouchDB logs (from however you are running CouchDB -- I'm not really sure how that works on Mac OS). But really debugging why your CouchDB isn't working isn't really something I want to do.
Also, I edited your password away when you posted your couchdb.json
. I assume you weren't using that password for anything critical or you don't care.
Ran curl on my Mac and got the following.
curl localhost:5984
{"couchdb":"Welcome","version":"3.3.1","git_sha":"1fd50b82a","uuid":"2eb45f12cb039deb09946f59a40532a7","features":["access-ready","partitioned","pluggable-storage-engines","reshard","scheduler"],"vendor":{"name":"The Apache Software Foundation"}}
I don't want you to do any research on my CouchDB problem. My immediate monitoring needs beyond importing the serial comma delimited output into a spreadsheet may go away. I had my installer and his engineer look at my fifteen year old Sanyo, now Panasonic, panels and they have suffered some serious degradation. I asked for a proposal from them to make my system whole and to process a warranty claim.
My wish to get SolarThing working on my Pi and CouchDB on my Mac is now just for personal education. If you don't want to take this any farther, I am okay with that. You have provided extraordinary support and I sincerely appreciate that. I just hate being stumped by a problem and while I have not working in IT since 2003, I like keeping my skills up at a minimum level.
Ran curl on my Mac and got the following.
So that means that the port is not listening on all interfaces and you should look into the bind address to set it to 0.0.0.0
or maybe some sort of firewall (which is unlikely because you had it working before).
I'm happy to help out with any SolarThing related stuff but I think I'm out of suggestions for your CouchDB stuff. Let me know if you need any additional help on the SolarThing side.
You have given me a couple of things to think about for how people want to use SolarThing, so some of these things I may look into in the future:
curl
command before going any furtherThose are good topics to consider. I might suggest a simple log.csv option for those who want an occasional snapshot in a spreadsheet. The process has been fun for me despite the CouchDB frustrations due to some peculiarities of my setup. You have been patient and supportive. Thank you for that. When my installer and his engineer came I had some good data to show them thanks to our efforts to get SolarThing running with CouchDB. Thanks a bunch.
I started to setup a CouchDB database running on my Mac on the same network as my Pi. Setup the couchdb.json config file as on the website and got the following errors.