FuckCombustion Community Enail Project (Name TBD)

Hippie Dickie

The Herbal Cube
Manufacturer
when i was debugging my PID i had the PIC write the temp readings (from MAX6675 - predecessor to MAX31856) to EPROM, which i could then upload and examine using the PIC programmer. Then i knew that the algorithm was getting good data.

i don't know, verify the pinout for that 5-pin plug? it's pretty straight forward to get the temp bits - set select, then loop: toggle the clock, read the data bit, for 16 bits (or whatever that MAX has) ... there is a bit that flags if the MAX doesn't see the thermocouple. then check connections between thermocouple and MAX.
 

JigMelon

Well-Known Member
when i was debugging my PID i had the PIC write the temp readings (from MAX6675 - predecessor to MAX31856) to EPROM, which i could then upload and examine using the PIC programmer. Then i knew that the algorithm was getting good data.

i don't know, verify the pinout for that 5-pin plug? it's pretty straight forward to get the temp bits - set select, then loop: toggle the clock, read the data bit, for 16 bits (or whatever that MAX has) ... there is a bit that flags if the MAX doesn't see the thermocouple. then check connections between thermocouple and MAX.

I've tested two different TC chips now, and I'm fairly certain that the issue is wiring. I'm not capable of writing original code to work with the chip on the OPi. Unless you have a way to compile something for the OPi using a 31856 library, we're just shooting in the dark. All of the libraries I've found thus far have dependencies that I couldn't get on the OPi. WiringOP/OPi.GPIO are installed which are for interfacing with WiringPi-designed software from an OPi. Each GPIO on the OPi is treated as if it were using WiringPi on a RasPi, so reading through the scripts/libs is rather confusing lol Here's the latest archive from them:

https://devices.hex-nail.com/dist/hexnail_controller/rq2/stable/hexnail-2.1.1.tar.gz

BTW, we have most of the source now in that archive, including for the compiled hexnaild binary! (scripts/Makefile details the build w/ nuitka) I'll have to do some further digging as I'm sure everything I need is there somewhere. I have work in 5 hours and I need to sleep!

In regard to just plugging in the TC chip out of the intended circuit for the sake of testing it, I'll see if I can get anything hooking it up to one of my old RasPis tomorrow. Should be much easier than on the OPi. If you have any ideas let me know. Again, I'm fairly certain my issue is a simple wiring mistake that could be solved with someone else mapping out their unit or someone with electronics experience closely examining my wiring diagrams
 

JCat

Well-Known Member
Accessory Maker
I might write you a small library, but don't have any 31856 boards handy on me; I've been using the MAX6675 board for my thermocouple readings. (resolution isn't as good, but don't think that matters considering the resolution is still much better than that of the thermocouples inside the coils ... could be wrong here though)

Anyways ... my next order from RobotShop I'll add one of those boards and write a quick sample typescript/nodejs app for you and/or python so you can test.

Really shouldn't make a difference if you are using an OrangePi or a RaspberryPi ... I also don't own an OrangePi board ... lol ... guess I should pick one of those up to help you guys out too!
 

JigMelon

Well-Known Member
Alright so I had a MUCH easier time diagnosing the issue with a RasPi rather than the Orange Pi. Everything I was using for testing just worked. It was a wiring issue, and I'll update my diagram later tonight. WOOOOOOOOOOOOOOOOOOOOOOOOOO

Now it's time to test out some of the hardware I bought by mistake, and try out other boards like RasPis.

Edit: Here's a parts list and diagram for my DIY

512MB Orange Pi Zero
Adafruit MAX31856 Breakout
Omron G3MC-202P-VD DC5
Illuminated SPST Rocker Switch
AC Power Entry Module
AC/DC Power Module
5 Pin Female XLR Connector

https://easyeda.com/editor#id=|bba7611ec531478792c71553b367c372

Please note, you can probably find each part cheaper elsewhere. There are also several suitable equivalents you could use. For the wiring diagram, please note that other than Yellow and Red, the colors in the diagram are meaningless; the colors are there to make the diagram easier to read. The Yellow and Red correspond to the K-type thermocouple wiring.
 
Last edited:

JigMelon

Well-Known Member
Quick update, I started testing out deployment of the hexnail suite on a fresh install of armbian on both xenial and bionic (on the Orange Pi, haven't tried RasPi's at all yet), and this weekend I'll be making a repo and a tutorial for those who wish to try it out. I might release it without the hexnail tarball and just include scripts to automate the necessary adjustments which would be run after downloading the tarball from the unit. I'm going to reach out to Brandon again and what I do depends on what he says. There is still no official license in the suite, but all of the sources are included and my current understanding is that the sources can be shared, since there is no licensing stating otherwise.
 

pxl_jockey

Just a dude
Um, Mr. Kotter? What, if anything, does this mean for members not owning a HN-01 or HN-02 but interested in building/buying DIY? I’m sorry man but you’re going to have to dumb it down a shade. :disgust: :lol:
Oh yeah, up your nose with a rubber hose!

EDIT: Please keep in mind that some of us are just having our morning coffee, with a side ofGreen Dragon & a few vapcaps. :haw: I should probably come back and read your post later... :ko:
 
Last edited:

JigMelon

Well-Known Member
Um, Mr. Kotter? What, if anything, does this mean for members not owning a HN-01 or HN-02 but interested in building/buying DIY? I’m sorry man but you’re going to have to dumb it down a shade. :disgust: :lol:
Oh yeah, up your nose with a rubber hose!

EDIT: Please keep in mind that some of us are just having our morning coffee, with a side ofGreen Dragon & a few vapcaps. :haw: I should probably come back and read your post later... :ko:


For people that do own an HN-02 (I can't confirm or provide steps for HN-01 until I get a RasPi3B), all they need to do is gain terminal/tty/cli access to their device and do the following:

Code:
cd /opt/nail
wget https://devices.hex-nail.com/dist/hexnail_controller/rq2/stable/hexnail-2.1.1.tar.gz -O /opt/nail/hexnail-2.1.1.tar.gz
tar -xvf hexnail-2.1.1.tar.gz
rm -rf hexnail-2.1.1.tar.gz
chown -R hexnail: /opt/nail/
python /opt/nail/updates/2.1.1/install.py

The device will reboot automatically and you'll be on v2.1.1 with homekit integration (I haven't tested) and AP mode working (found at http://ip.of.hex.nail:8890). To gain access there are many things you could do. Easiest (IMO) would be to adjust the /etc/shadow file with new passwords and then connecting with a TTY adapter. You could skip the TTY adapter by also enabling PasswordAuthentication in /etc/ssh/sshd_config and connecting via SSH. Another option would be chroot-ing into the filesystem from another environment. I won't go further into these since there's plenty of documentation available elsewhere. For those with a unit, all you need is command line access and to run the above commands.

I feel much more comfortable teaching people how to make their own than how to "hack" an official unit.

The tutorial I am making is for people who do not own an official unit and would like to make a DIY unit. It will be as simple as flashing the official Armbian (the operating system) image onto an SD card, and then running a few simple commands that will be fully outlined in the tutorial. My intention is to have most of the configuration automated to make it easier for people who are inexperienced with Linux/bash. It may sound like mumbo jumbo right now, but I assure you that it will be very straightforward along with the tutorial. Once I'm certain that it will not be illegal to do so, I'll also post a pre-configured image which will take away the need to perform any of the steps, unless you wanted to make additional modifications and/or update software.
 

toasted

Well-Known Member
For people that do own an HN-02 (I can't confirm or provide steps for HN-01 until I get a RasPi3B), all they need to do is gain terminal/tty/cli access to their device and do the following:

Code:
I feel much more comfortable teaching people how to make their own than how to "hack" an official unit.

The tutorial I am making is for people who do not own an official unit and would like to make a DIY unit. It will be as simple as flashing the official Armbian (the operating system) image onto an SD card, and then running a few simple commands that will be fully outlined in the tutorial. My intention is to have most of the configuration automated to make it easier for people who are inexperienced with Linux/bash. It may sound like mumbo jumbo right now, but I assure you that it will be very straightforward along with the tutorial. Once I'm certain that it will not be illegal to do so, I'll also post a pre-configured image which will take away the need to perform any of the steps, unless you wanted to make additional modifications and/or update software.


I am very interested in building one of these! I've got a lot of linux admin, and a bit of pi, arduino and electronic tinkering experience. I'm in Canada so the only stumble is tracking down the right parts that I don't have for this project... especially a coil or two.
 

jojo monkey

Well-Known Member
Manufacturer
I'm still working backward towards you @JigMelon. Your diagrams and documentation are super helpful. Thanks!!!!!

I've got the mozilla things stack running on the orange pi zero h2 rasbian image. I also have a second server using python that is creating the PID interface using the gateway's API.

So the next step is to write some logic and try out some PID code. This might take a bit, but having the interface out of the way is pretty good.

Here is my first go at the buttons using the API (none work yet). The temp will display in the center once I write the PID and GPIO code.



Here is a video of me poking around. I put two chromebooks next to each other to show how it operates over the wifi. There is a google speaker there too to show how fast it can respond. Most of the buttons are virtual, but hitting one still needs to run through the software stack.


IMO a HUGE perk of the things gateway is that a "things" can be something like a PID or it can also just be a virtual empty button that you can program to do what you want. In this video I make a button program the pid settings and turn on a different switch. Imagine if you used different nails and wanted a quick button to switch, this is how it could work.


One last perk is that all of these "things" become available to any REST call so you can write your own web app if you hate this interface. You could use the REST interface to hit buttons that have complex rules.

The python pid server runs on port 8888
The things gateway runs on port 8080
You could make your own server on port 80.
 

Hogni

Honi soit qui mal y pense
Guys, I really don't understand anything of what you all are doing but it's great for sure - at least your engagement for the community. Hope to get a FC controller in my hands/on my desk next year.

Really appreciate your work! :bowdown:
 

JCat

Well-Known Member
Accessory Maker
Just thought I'd share this with you guys ... should have a working prototype in the next week or two (time permitting) ... want to re-write my server stack, and then the client ...

I could use some help as far as design ideas for the mobile app (my first version to communicate w/ my eNail Magic device I really hate the UI! :lol: ) ...

The main features for the mobile app would be:
- Home screen: Main screen for adjusting temps, selecting presets, etc. -> Features: preset temps, adjust temp, ???
- Session screen: For running programs (ie. up-temps, down-temps, etc.) -> Features: select session, run session, create/edit session profile, etc.
- Profiles screen: For tuning/adjusting PID settings for different nails -> Features: Auto Tune, select PID Setting, Save PID Settings, delete PID setting
- Settings screen: Network settings, ...

Probably use standard tabs/menus for navigation etc., but it's more the layout/look/feel of the individual screens that I'm after. I'm a software developer, not a graphic designer :lol:

Here's a picture of the initial front/back of the hardware ... used some 1/4" Baltic Birch plywood as an easy to work material to use for prototyping (at least easy enough to work). I'll probably get a buddy to 3D print cases once I'm happy with the size/design. I think I'll likely eventually recess the back power and coil connectors so that when the power and coil are plugged in, they take minimal room behind the device (we'll see what space is like once it's done).

The hardware on the front is:
- Omron E5CC-QX2ASM-802 (has RS-485 for communications using modbus)
- 128x64 OLED display
- Illuminated toggle/push button for manual coil switch. (light can be controlled separately so am using for notifications as well). Coil can be turned off by software as well.
- Rotary encoder, push to use as "select" button to change from "temp" mode, to "session" mode, to "profile" mode. "Select" button also used when in sub-menus. Rotary encoder allows navigation, changing of temps, etc.
- Button (green). This is the main "enter" button. Not too fancy but it will work for now! Long term maybe I'll get a circuit board built with all the components built-in ... would make it more compact.

Inside the device on the base I'll still need to secure: 110V AC to 5V USB module, relay, Pi Zero, and in the top the speaker/audio module.

IMG-0030.jpg


IMG-0031.jpg
 

JCat

Well-Known Member
Accessory Maker
Ok ... so lost 8 hours of my life trying to get the RS-485 module (pmodrs485), and ended up giving up; pretty sure the module itself is no good! I had another USB to RS-485 module so I built myself a custom USB cable and hooked that up instead for now. I'll order a different $10 rs-485 module to see if that will work ... because it should!!! :lol:

Once I got it all wired up, had some time to play around with it, and got the RS-485 reading the temperature from the Omron as well as got it updating the set point, starting/stopping the device (ie. turn on/off the coil using the Omron), etc. I've validated that I'll be able to do everything I need to and more!

Pretty excited about this ... will really cover all my bases out of what I want from an eNail ... (different profiles for different devices, auto-tune, high quality 2-DOF PID control, ability to run "scripts" for up-temps/down-temps, dial to adjust the temperature!, ...)

Next step will be to write the rudimentary server (device) code. Initial version just going to focus on stubbing out the bulk of the functions, and integrating the temperature knob, and exposing everything over socket.io (http). I'll then convert a bunch of my eNail Magic code for the running of scripts etc. Once I have that ported over and I have the functionality setup for temp adjustments and running scripts, then I'll work on the mobile app side of things.

Considering 2 different paths for network config:

1. Expose network settings page over Bluetooth and allow config of network using Bluetooth
2. Default/fallback to AP mode (along with a factory reset procedure to reset network)

Anyways ... here's some pics of what it looks like with all the electronics hooked up and started to glue up the case:

IMG-0037.jpg
IMG-0038.jpg
IMG-0039.jpg
 

maxvapor710

Manufacturer
Manufacturer
If you guys have standardized on a set of hardware I would be happy to get one of the guys here to make a blank circuit board to build off of, it would be pretty easy to make a slot / socket for a pi zero to drop in if you are going that route.
 

Doktor Dub

Well-Known Member
Guys, I really don't understand anything of what you all are doing but it's great for sure - at least your engagement for the community. Hope to get a FC controller in my hands/on my desk next year.

Really appreciate your work! :bowdown:

Couldn t say it any better! :tup:
 

JCat

Well-Known Member
Accessory Maker
If you guys have standardized on a set of hardware I would be happy to get one of the guys here to make a blank circuit board to build off of, it would be pretty easy to make a slot / socket for a pi zero to drop in if you are going that route.
That's a super awesome offer! Very generous :)

I'm using all "modules" that plug in to the pi (I have built a few as well such as the button board you can see in above picture ... as well as an audio board ... but this version is all plug/play components (apart from the button module which I can buy ... I just didn't have any on hand but had the parts to make it ... so quicker to build then to wait 2 days shipping ... + $10-$15 in shipping costs :) )

The modules required for this build are:
- UART to RS-485 (the pmodrs485 one I had wasn't working, so I'm currently using USB to RS-485, but this won't be the permanent solution ... there's really no difference in the software ... and once I get it working it will just "work" ... just an update in the config to the serial reference)
- 128x64 OLED module
- rotary encoder w/ push button
- button module (button drives pin low)
- the coil switch on the front that switches the AC for the coil also has a LED that the software uses for feedback--driving from pin on Pi (ie. if you turn the coil off using the RS-485/omron as opposed to the physical switch the LED goes on/off ... flashing when running script ... etc.)
- Omron 2A relay - G3MB-202P (3-5A would be good ... but 2A should be fine for up to a 200W coil) --since this is a 5V module, I'm stepping down the 12V voltage output from the Omron using a 660ohm resistor (made a custom wire with the resistor soldered inline for the positive. This isn't hooked up to the Pi for signalling ... it's controlled strictly by the Omron ... I didn't see a point in hooking it up to the Pi as the Pi can turn off the coil by sending RUN/STOP signals to the Omron through RS-485.
- 1 wire speaker/audio module--don't need much volume, just for feedback purposes

I've got a first version of the device enail software running ... this one has the following implemented:
- plays startup audio at boot
- only main temp mode is implemented:
- button turns heater on/off (by signalling Omron PID through rs-485)
- rotary encoder adjusts temperature up/down (I even implemented acceleration/deceleration on this as otherwise it just didn't "feel good" ... now I like it a lot!)
- LED on heater coil switch/button illuminates/turns-off based on heater status (in Omron)

It's really working even better than my expectations to-date (apart from the pmodrs485 module that I wasted so much time working on for nothing!)

Here's a pic of it running .... video to come later ... just did my first manual up-temp on it using the rotary dial to manage the temps ... it actually worked REALLY WELL! Yay!

IMG-0042.jpg


Very, very pleased with the results. I've really liked the Omron E5CC PID as far as quality of PID/temperature control and features such as auto-tuning; what I didn't like about it were the buttons and UI ... this solves that problem as I no longer have to touch the Omron buttons! I actually think I'll lock them out once I'm complete so you can only control it though the software and other controls. Any advanced features accessible in the Omron I'll be able to make accessible in the mobile app, and for general usability, the rotary encoder and button satisfy my needs.

Next step is to port my e-nail magic software that runs the scripts so I can do programmed/scripted up/down temps etc with feedback to the OLED display, audio, etc. I could re-use it pretty much just swapping out a couple chunks of code, but I want to move the application state into a server-side redux store as I think from a long term maintainability and stability of the software this will be the way to go. (anyways ... software developer speak ... :lol: ...)
 

JCat

Well-Known Member
Accessory Maker
Ok ... so here's a video with a demo :)


Here's a link to the source code on GitHub: https://github.com/J-Cat/fc-enail

Anyone is free to download/modify/use the source, but it is not free to use commercially in existing or derivative forms (it's free for personal use though!)

If anyone has extensive experience with Raspberry Pi's, NodeJS, Typescript, Redux, React, Socket.IO, Apache Cordova, etc., then let me know if you want to help out with the code. This is a stack I work a lot in these days so I'm pretty fast at it :) ... I'm doing something a little different here though with redux managing the state on the server/hardware as well ... it fits well due to the nature of the hardware and the fact that the hardware controls are essentially a "client".

I'd like to get it down in size (maybe 2/3 the width) which should be achievable if I can either:
a) get a board built with sockets on one side for the modules
b) get a board built with build-in modules (ie. replicate the OLED/I2C, rotary encoder, and push button on it's own board ... the OLED/I2C one is the complicated one here :) )

Next steps:
1) write code for running "scripts" (ie. up-temps, down-temps, etc.) ... re-using some of the e-nail magic code here ...
2) write code for running auto-tune and saving profiles (not sure I really want to make this accessible without the mobile app ... unless I default the naming "profile 1", "profile 2", ... and only allow re-naming in the app ... think it might be a pain to implement the writing logic with 2 buttons and a rotary encoder!)
3) write mobile app/client

If anyone has some ideas for the user interface look/feel, I'd appreciate some feedback!
 
Top Bottom