MartinNohr / MagicImageWand

Paints Images in the Air with LEDs
Apache License 2.0
20 stars 6 forks source link

progress and suggestions #1

Closed MartinNohr closed 3 years ago

MartinNohr commented 3 years ago

Let's continue our discussions from the lightwand post here. I'll start by saying that I now have my test code on the TTGO getting closer.

MartinNohr commented 3 years ago

Thanks. We're having an interesting time... We drop food and presents at the door for my daughter and grandson. They both have covid so are confined to their house. Slight fevers and tired, but otherwise they're fine. They were in our car two days before they had any symptoms, so we were a little bit worried. We got tested and we don't have it, at least not yet! So we had a very quiet Christmas this year. We did use Skype for opening the presents. We do that Christmas eve, remember I was born in Denmark, so that's my heritage.

MartinNohr commented 3 years ago

I put up new code this afternoon. I found a font that I think is much better. I had to shorten some of the menu lines, but it is much easier to read. I also added a system setting to change the menu colors. I'm not completely satisfied with how it works, so I will probably change it later when I think of a better way.

MartinNohr commented 3 years ago

I added the IP address to the main menu so you can find it. Dirk: Do you mind if I make some changes to the wifi code? I like what you have done so far, but it does need a bit more work. I see the uploading isn't working yet. It would also be nice to be able to get a list of the files down to the web browser. I think this is going to be much better than using Bluetooth. Thanks for your work on this, it's a great start. I think I'd like to see the settings and be able to change things from the computer/phone web browser. This is going to stretch my knowledge of HTML and buttons and things that I have only a passing familiarity with.

dirkessl commented 3 years ago

It was a very strange Christmas, indeed. We have a lockdown here in Germany so we are not allowed to be outside between 21:00 and 5:00. The kids were with us and we had a nice evening, but it was strange sending them home at 20:30. If you are outside at night without any urgent reason the police fines you at least EURO 500. My parents in law picked up food and presents from our doorstep as you can only celebrate with one other household so it was really strange not celebrating with them.

dirkessl commented 3 years ago

@MartinNohr yes please change the code, as I am not very good in programming these advanced features. If you just put basic html code there, I can make it look prettier and responsive if you wish.

I am also thinking about the remote functionality, on how to implement this in a clever way. I guess we have two options here. We can either send commands to a remote unit with a webrequest when a pattern/image runs to a fixed address like http://192.168.4.100/remotestart and http://192.168.4.100/remotestop or we offer an URL which gets pulled by the receiver (http://192.168.4.1/isrunning), but I guess this will harder as the remote receiver needs to constantly pull the website of the MIW which might generate too much load or cause stutter on the MIW. I think I would prefer the first way. The receiving unit could then have a status LED which shows if the unit has received the command or it could use the display if we use another TTGO-Display or the other Board I found with the antenna connector.

MartinNohr commented 3 years ago

We'll have to do a little experimenting to determine how much load we can put on it. It is a dual processor and pretty fast. Running the leds doesn't use too much computer time. What I don't know is if both of those processors are actually used when we compile single thread stuff. We might have to start using FREERTOS! I'm sure it supports both processors for tasks. It would be fun to have a real OS to work on again. Anyway, just thinking out loud. It must be strangely quiet in the evening and night there. Almost no traffic, right?

MartinNohr commented 3 years ago

I noted in the WiFi comments, but I'll mention it here also. I fixed the file upload to SD using WiFi. It does need some improvements.

MartinNohr commented 3 years ago

I added a little feature. Pressing button 0 (on the board) will always display the image no matter what else is on the screen. Pressing it again restores whatever was going on before. Note that it doesn't work if an image is actually being shown on the LED strip of course. I suppose we could make button 0 do other things, but I got tired of selecting a menu item to preview the file.

MartinNohr commented 3 years ago

Dirk: Would you consider adding the sources for the STL files? Some people might need to modify them slightly for different extrusions.

dirkessl commented 3 years ago

@MartinNohr sure, but as I use TinkerCAD for all of this, I can only supply online links. I guess I need to learn some Fusion360, I already have a license for it and think I will be much faster once I mastered it.

dirkessl commented 3 years ago

Quick Update, I took the time today and learned Fusion 360 and created the basic case. I need to print one first, before I can make more adjustments, as I guess I did not include enough tolerances for 3D printing. But it is a good start and Fusion is really powerful.

DaveStu commented 3 years ago

Morning/Evening gentlemen. Hope the Christmas holidays was a happy and healthy one. I've been busy with things, so havent had time to check in, but see progress in well ahead. I won't get time until a few days into 2021 so with that I'll say Happy New Year to you both and to all your family and friends. Lets hope 2021 is a true turn around from the fiasco of this year. Cheers and salut.

MartinNohr commented 3 years ago

Thanks Dave. Happy New Year to you all. My daughter and grandson recovered from Covid in a couple of days. It must be nice to be young! Even though we were in the same car for an hour the night before she developed symptoms, we didn't get it. She did lose her sense of smell, but it is coming back.

MartinNohr commented 3 years ago

Dirk: I started out with TinkerCad, but I was never very good at it. Due to my teaching part time at the University I got the educational license for Fusion 360. I'm always amazed at the good designs people can do with TinkerCad, even yours, I can't do that much with it. Fusion however is a very powerful tool. I found rounding edges and editing shapes much easier in fusion. It also handles multiple shapes that fit together in a single file very nicely. Fusion does have a longer learning curve. Threads and holes are handled extremely well in Fusion. And yes, 3D printing is not like machining, tolerances have to be accounted for, and even worse, unless the printer is well calibrated (mine is), then things won't fit!

MartinNohr commented 3 years ago

Links to the TinkerCad are ok, as long as the project is shared. Many people so use TinkerCad. You can import TinkerCad models to Fusion but I find they don't always work well, so I often start over. One big problem is that only basic shapes from TinkerCad get imported, not any of the fancy extension/plugin features.

krealab commented 3 years ago

Hi! Im a photographer with interest in tinkering and some programming. I would love to make a light wand for light painting pictures. Do you know if this code could be tweaked for use with m5 stack core or core2 ? It has a screen and a Sd-card reader, so i think it should be perfect for such project. I just dont have the knowledge to program it yet. Stay safe and all the best from Northern Norway. Kolbjørn.

MartinNohr commented 3 years ago

I could probably make it work on that m5 stack. I thought of using one once. I would have to get one and see how hard it would be. And I would have to find the time to test it. If you want to keep it simpler I do have a PCB made with the TTGO and an SD card reader attached. Anyway, I'll go look at the m5 stack specs to see how easy it might be to port the code. I've been to Norway a few times. I was born in Århus and until I was 18 I lived in Ryomgård Denmark. Jeg kan godt læse norsk, dog ser det ud som om der er mange stavefejl. :-)

krealab commented 3 years ago

Always good to hear that people visit Norway! You hva probably not been so far north as i live in Vesterålen. :) I just thought it would be a perfect project for the M5 Stack system. I have the Core and Core 2. By the way i have been to Århus once. Thats a tech city right?

MartinNohr commented 3 years ago

No, I have not been that far North! I walked up and down Holmenkollen and decided that skiers were crazy people. I was mostly in and around Oslo. Loved that big park with statues all over. I ordered a core 2 from China that I will experiment with. I looked at the docs and it looked like it should be easy enough to port.

MartinNohr commented 3 years ago

I'll be back working on this project now. I want to improve the web interface. I also want to make the remote camera control work. I've got the cable for my Nikon and I have verified that it works! I have been busy finishing another project and haven't had much time to work on this one. https://www.thingiverse.com/thing:4723557

krealab commented 3 years ago

I will have to get a TTGO and test it. Never tried. I actually started a makerspace up here for kids. Maybe we could hire you for a weekend or so after corona. https://www.facebook.com/makerspacevesteralen

MartinNohr commented 3 years ago

I'd love to come up to Norway... but it's a bit of a trip now, I am currently living in Utah.

dirkessl commented 3 years ago

Long time no read, I started a new job in January and everything is going well. Currently I am off the Computer in the evenings and am painting figures from my new resin printer. Very relaxing and a lot of fun. Weather is also pretty bad in Germany, so photography is not nice at the moment. We also need to wait for the government to lift the curfew, as my favourite places are out of reach at the moment as we have to be home at 9pm. But I am ready to make more tests and help with ideas, of course. Looking forward to get some progress on the remote functionality. @krealab I have built a remote timer based on the M5, you can read about it here: https://www.essl.de/2020/10/23/timy-the-open-source-camera-timer/ We decided against the M5 as its logic circuit is 3.3V and while this works with most LED strips, some might have issues so a Logic shifter is needed. Martin has created a board which has this integrated, but its not needed with the TTGO as it is a 5V board. I also find the buttons not really good on the M5 and power management is a mess on this device.

MartinNohr commented 3 years ago

The TTGO is a 3V3 board, it is not 5V. It will take 5V input because it has an onboard regulator. The TTGO is an ESP32 and it is 3V3. I have finished my new PCB with the level shifter and the rotary switch on the board.

MartinNohr commented 3 years ago

I made a change to the code today. The other button now acts like a long-press so you can use it to jump in and out of the menus.

DaveStu commented 3 years ago

Afternoon/Morning gentlemen, it's been a while and hope all are well. Similar to Dirk, i've have been working with photography mostly dead in the UK rules changing constantly, I've been juggling between 2-3 jobs to keep things going and now has been shifted to one for the time being. I'm eagerly trying to catchup on the progress of the wand and all the new changes, which to me feels like months ago when last last I worked on it.

DaveStu commented 3 years ago

Found an interesting program, especially for people who don't program as such. It uses visual logic to interface with controllers and help to create code for them. Its this https://xod.io/ Probably help any future projects I get into

MartinNohr commented 3 years ago

xod is interesting but I have seen many attempts at that kind of thing in the past, none have really interested me, but then I'll admit that is largely because I'm already a moderately competent programmer.

MartinNohr commented 3 years ago

Note that in the latest code I added an information screen to the preview, just click the button. It now shows the distance to walk to maintain square pixels. I found in using the wand that I had to make several test shots to get the ratio correct of images. for some patterns it doesn't matter, but often it does. That info screen also shows the approximate number of seconds using the current frame hold time.

MartinNohr commented 3 years ago

I created a new branch with new features and many internal changes to the code. There is now a preview of built-in patterns. The display can mirror the LED as it is being displayed to give a better idea of the image progress. The code has been improved for ease of managing variables. The EEPROM library is no longer used. I replaced it with the much better preferences.h library. I have also started to implement a new feature in the macros that will indicate how long it takes to display the macro. There might also be a feature to over-ride the macro settings like the hold time, but I am still thinking about how best to do that. I will leave this as a branch until it has been tested more to make sure it all still works.

MartinNohr commented 3 years ago

I added sideways scrolling to long lines. They now scroll to the end, and then back again so long lines can be seen. This is especially useful for long filenames and paths. It is also useful for longer menu names. There are adjustable settings to control the scroll speed, return speed, and the pause at each end.

MartinNohr commented 3 years ago

I added a confirmation screen to anything that deletes files or settings. I accidentally deleted a macro file because it just quietly erased it. I also added a switch to ignore the settings that are stored in the macro file. Sometimes you might want to change the settings. I have merged the new code into main. Please let me know if any problems are found. I'll update the documentation soon to reflect the new features.

ThomasKlee64 commented 3 years ago

I got the stick working and everything is working great, thank you for this great work. One more thing I noticed or I do not operate the menu correctly. For example, when I start the stick, all the settings I made in the System Settings (Display Brightness, Text Color, Show BMP on LCD, etc.) are always reset to the original state. Is this the way it should be or am I doing something wrong here.

MartinNohr commented 3 years ago

Under saved settings: set autoload to yes and save the current settings. I have considered making all the system settings automatically saved. That probably makes sense. I'll change in a future version soon. The LED controller and count settings are always saved and loaded regardless of the autoload setting, but I agree, the system ones should also be saved and loaded all the time.