Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify this project using a Raspberry Pi Zero #3

Open
davidknezic opened this issue Jan 24, 2019 · 15 comments
Open

Simplify this project using a Raspberry Pi Zero #3

davidknezic opened this issue Jan 24, 2019 · 15 comments

Comments

@davidknezic
Copy link
Owner

Currently, this project is quite complex to implement due to the Hub/desk module combo and the ZigBee communication.

I think it might be time to simplify this project using a simple Raspberry Pi Zero. There, WiFi and GPIO handling can all happen on one device.

@MartinNuc
Copy link

I am definitely going to control by desk from a RPI itself... I will eventually let you know when I progress further. I am still waiting for the table.

@davidknezic
Copy link
Owner Author

Awesome! Let me know how it goes 🙂

@MartinNuc
Copy link

Finally had time for this during the quarantine 😷

It turns out that Raspberry GPIO pins are only 3.3V while Arduino is 5V. I am afraid that LogicDesk sends 5V which would destroy my RPI and I don't have currently a multimeter to measure it 🙁

@davidknezic
Copy link
Owner Author

Hi @MartinNuc, good to hear from you!

The Raspberry Pi has two 5V pins (2 + 4) that come directly from the 5V power supply.

With a step-down or step-up level shifter circuit you can interface with the LogicDesk circuit. They consist of simple components and I've used them on several occasions.

Maybe this will work for you too?

@MartinNuc
Copy link

@davidknezic ordered step down/up yesterday. Should arrive in following days 🤞

@MartinNuc
Copy link

FYI I am almost done with the driver for raspberry. Its my first project in Rust therefore the code is 💩

https://github.com/MartinNuc/logic-data-controller

It exposes REST API for controlling the table. Honestly to avoid step-up/down shifter I would prefer Arduino 😀

@davidknezic
Copy link
Owner Author

Thank you very much for sharing! Rust seems to be very cool.

The only reason I though migrating to Rpi Zero W was because it's cheap, has Wifi and runs Linux (for HomeKit). But I guess the same things can be achieved with an Arduino. If you find a model, I'd love to know which one you went with. I totally agree with you that it makes sense to use the board that makes things easiest.

@MartinNuc
Copy link

Unfortunately you cannot run linux on Arduino. So using raspberry is really "one-package" solution but the setup of wires is rather complicated 😱 ... see the photo 🙈

IMG_4240

@MartinNuc
Copy link

There is an issue with raspberry that it doesn't manage to keep the loop under 1ms. Especially when there is something else going on on the device. Therefore it reads the signal wrong.

At first I wrote the driver in Typescript and I thought the reason it run fast enough is Javascript - maybe garbage collector. But even with Rust I see lagspikes which causes to skip reading bit or even more from the signal channel time to time. Which results in delays when reading the table height.

Really looks to me that using Arduino for this is much better solution :-)

@MartinNuc
Copy link

After using it for some time it mostly works ... I am pretty much sure there is still the problem with delayed reading of the signal channel.

I am wondering - using Arduino - does it happen that the table controller display stops showing height values? And sometimes that it resets memory positions?

@davidknezic
Copy link
Owner Author

Glad to hear that it's been working so far.

Yes, at some point the controller stops sending the height. I noticed that I just have to give a very short impulse (up or down) to make it send the height again. If the impulse is short enough, the desk won't really move.

About the memory positions, I'm not sure. Do you mean the programmable heights you can set on the hand switch? Unfortunately, I don't have those.

@ryanschmidt
Copy link

Just stopping by to say this project is amazing and I’d love to try it. How is the setup working out?

@visini
Copy link

visini commented Oct 22, 2020

I'm currently waiting for parts, but will give this a try (using RPI only). Many thanks @MartinNuc and @davidknezic for the amazing work on their respective projects. Looking forward to get this going!

@davidknezic
Copy link
Owner Author

Hi @ryanschmidt @visini thank you for the kind words!

How is the setup working out?

@ryanschmidt I myself still run the original setup described in this repository and it is very reliable.

Still have the plan to migrate to a Raspberry Pi Zero W only setup, but the lack of real-time processing that @MartinNuc has mentioned earlier will be a challenge. I wonder if running the kernel in real-time mode would help there.

@visini just saw your issue over at MartinNuc/logic-data-controller#1. Will compare it to my wiring an let you know what I find out.

@dpinna13
Copy link

dpinna13 commented Dec 2, 2021

@davidknezic I was thinking to simplify this by separating the device into two. An ESP32 or ESP8266 running the arduino code and connected directly to the wifi. The rpi (or anything really) acting as a server that connects to the ESP and exposes it to homebridge. I have a similar setup for an IR emitter that acts as an AC remote so it shouldn't be too hard -- (last famous words).

Repository owner deleted a comment Feb 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants