tofubl

joined 1 year ago
[–] tofubl@discuss.tchncs.de 2 points 2 weeks ago

Good job troubleshooting.

[–] tofubl@discuss.tchncs.de 2 points 2 weeks ago

5V or 4.68V input isn't meaningful. The sensor has some input range and 4.68V most definitely falls into that. Could be a design choice that has no real implications.

On the other hand, if the device normally supplies 5V, just yours doesn't, then that's further evidence you have a faulty controller.

[–] tofubl@discuss.tchncs.de 1 points 2 weeks ago* (last edited 2 weeks ago) (2 children)

My money is on faulty controller at this point, but I think you'll need to find someone with electronics chops if you want to avoid just buying parts until it works again.

For what it's worth, I didn't mean take the sensor out of the wall, but just electrically unplug it from the controller to see what it does on its own when you turn on the water.

A frequency counter won't really help you here, I think. You already know to expect ~VCC/2 when water is running, and either VCC or 0V if it isn't. The speed of the square wave isn't very relevant.

[–] tofubl@discuss.tchncs.de 1 points 2 weeks ago

Oh and be careful if you do end up trying it.

There's no safety risk in what I described, but reversing the power supply might very well fry the device.

[–] tofubl@discuss.tchncs.de 2 points 2 weeks ago (7 children)

With better tools, it would be easier to troubleshoot more precisely. An oscilloscope would help you understand what's going on, for example.

From what you describe, I'm actually starting to suspect the other end (the controller?) to be the problem.

One idea you could try before buying anything is to disconnect the sensor, supply it with 5V and ground (double check with data sheet!) and see what's happening on the output when there is flow. If you don't measure anything, as I would expect since the pin alternates between a floating state and ground, you then add a 10k or 50k ohms pullup resistor between 5v and output and measure again, and should get the levels you expected to see in the first place.

Don't know if you're comfortable doing this, but maybe you can find somebody to help you out?

[–] tofubl@discuss.tchncs.de 2 points 2 weeks ago (9 children)

Read your post again, and your readings are of course not in line with what I laid out. Are you measuring the sensor in-system?

If you are, the sensor might indeed be faulty. If you aren't, you probably need a pullup resistor on the output pin.

[–] tofubl@discuss.tchncs.de 2 points 2 weeks ago* (last edited 2 weeks ago) (10 children)

These flow sensors are usually hall effect sensors, with two or four magnets attached to a rotor with a little water wheel. When water flows, the magnets turn and create something like a PWM signal at the output (actually it's high level when magnet is there and low level when magnet is not there or vice versa). Measuring the pin with a slow multimeter, this would indeed give you approximately half the supply voltage when water is flowing, depending on a few other factors. So- readings sound sensible to me. To note that if the rotor stops with a magnet close to the hall effect sensor, you will read 5V (or VCC) at the output, but always VCC/2 when flowing.

Most of these sensors employ an open collector output stage, but that doesn't need to bother you with the readings you're getting, I think.

[–] tofubl@discuss.tchncs.de 1 points 1 month ago

No harm in giving it a try, but I personally wouldn't bother with a selfhosted solution for it. Especially if you're not sure it will work out.

[–] tofubl@discuss.tchncs.de 1 points 1 month ago

Well, paint me green and call me a pickle. More power to you if it works. 😊

[–] tofubl@discuss.tchncs.de 3 points 1 month ago (4 children)

Tangent, unsolicited:

Music lessons over video call, that has to be a real pain. I can't find it now, but there's an Adam Neely video where he talks about why online recording sessions can't work, as transmission latency works against the immediacy needed to play music together. He said it better than I can.

Except if your idea is to play in turns, but then capturing the thing you want to show... Can't you find another teacher closer to you?

[–] tofubl@discuss.tchncs.de 15 points 1 month ago* (last edited 1 month ago)

Installing the Jellyfin add on into kodi takes a few minutes. Nothing much to consider, just try it and see if that changes anything.

I have a similar setup (rpi with OSMC, media hosted on file server) and prefer using Jellyfin as the source for all clients, as it keeps track of watched status across everything. It's not perfect, but better than without Jellyfin.

0
submitted 8 months ago* (last edited 8 months ago) by tofubl@discuss.tchncs.de to c/selfhosted@lemmy.world
 

Nextcloud seems to have a bad reputation around here regarding performance. It never really bothered me, but when a comment on a post here yesterday talked about huge speed gains to be had with Postgres, I got curious and spent a few hours researching and tweaking my setup.

I thought I'd write up what I learned and maybe others can jump in with their insights to make this a good general overview.

To note, my installation initially started out with this docker compose stack from the official nextcloud docker images (as opposed to the AIO image or a source installation.) I run this behind an NGINX reverse proxy.

Sources of information

Improvements

Migrate DB to Postgres

What I did first is migrate from maridb to postgres, roughly following the blog post I linked above. I didn't do any benchmarking, but page loads felt a little faster after that (but a far cry from the "way way faster" claims I'd read.)

Here's my process

  • add postgres container to compose file like so. I named mine "postgres", added a "postgres" volume, and added it to depends_on for app and cron
  • run migration command from nextcloud app container like any other occ command. The migration process stopped with an error for a deactivated app so I completely removed it, dropped the postgres tables and started migration again and it went through. after migration, check admin settings/system to make sure Nextcloud is now using postgres. ./occ db:convert-type --password $POSTGRES_PASSWORD --all-apps pgsql $POSTGRES_USER postgres $POSTGRES_DB
  • remove old "db" container and volume and all references to it from compose file and run docker compose up -d --remove-orphans

Redis over Sockets

I followed above guide for connecting to Redis with sockets with details as stated below. This improved performance quite significantly. Very fast loads for files, calendar, etc. I haven't yet changed the postgres connection over to sockets since the article spoke about minor improvements, but I might try this next.

Hints

  • the redis configuration (host, port, password, ...) need to be set in config/config.php, as well as config/redis.config.php
  • the cron container needs to receive the same /etc/localtime and /etc/timezone volumes the app container did, as well as the volumes_from: tmp

EDIT Postgres over Sockets

I'm now connecting to Postgres over sockets as well, which gave another pretty significant speed bump. When looking at developer tools in Firefox, the dashboard now finishes loading in half the time it did before the change; just over 6s. I followed the same blog article I did for Redis.

Steps

  • in the compose file, for the db container: add volumes /etc/localtime and /etc/timezone; add user: "70:33"; add command: postgres -c unix_socket_directories='/var/run/postgresql/,/tmp/docker/'; add tmp container to volumes_from and depends_on
  • in nextcloud config.php, replace 'dbhost' => 'postgres', with 'dbhost' => '/tmp/docker/',

Outlook

What have you done to improve your instance's performance? Do you know good articles to share? I'm happy to edit this post to include any insights and make this a good source of information regarding Nextcloud performance.

view more: next ›