ammolytics / projects

Source code and instructions for do-it-yourself projects.
https://blog.ammolytics.com
MIT License
49 stars 20 forks source link

Installation Problems #28

Closed GTMux closed 4 years ago

GTMux commented 4 years ago

This project is great! And I would love to bring it in our shooting club for these people who like accurate reloads. Unfortunately I'm not able to get the RPi Zero running due to problems during the installation process:

. . . .

npm install

bluetooth-hci-socket@0.5.1 install /home/pi/node_modules/bluetooth-hci-socket node-gyp rebuild

make: Entering directory '/home/pi/node_modules/bluetooth-hci-socket/build' CXX(target) Release/obj.target/binding/src/BluetoothHciSocket.o In file included from ../src/BluetoothHciSocket.cpp:8: ../../nan/nan.h: In function ‘void Nan::AsyncQueueWorker(Nan::AsyncWorker)’: ../../nan/nan.h:2298:62: warning: cast between incompatible function types from ‘void ()(uv_work_t)’ {aka ‘void ()(uv_work_s)’} to ‘uv_after_work_cb’ {aka ‘void ()(uv_work_s*, int)’} [-Wcast-function-type] , reinterpret_cast(AsyncExecuteComplete)

... ... ... gyp ERR! build error gyp ERR! stack Error: make failed with exit code: 2 gyp ERR! stack at ChildProcess.onExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23) gyp ERR! stack at ChildProcess.emit (events.js:198:13) gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:248:12) gyp ERR! System Linux 4.19.75+ gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" gyp ERR! cwd /home/pi/node_modules/bluetooth-hci-socket gyp ERR! node -v v10.17.0 gyp ERR! node-gyp -v v5.0.5 gyp ERR! not ok

cyclepath37 commented 4 years ago

Update: I continued to struggle with bluetooth connection loss as many others had also. It would connect, then drop and sometimes take several attempts to reconnect, followed by dropping it again. I ended up ordering a different serial cable. It must have been the cable because the new cable has connected right away with no loss after running it for 20 minutes!!!! Here is the cable I ordered USB to RS232 Adapter with PL2303 Chipset, CableCreation 3.3 ft USB 2.0 to RS232 Female DB9 Serial Converter Cable for Cashier Register, Modem, Scanner, Digital Cameras, CNC, 1M Black https://www.amazon.com/dp/B0769FY7R7/ref=cm_sw_r_cp_api_i_EHphEbVHZDVP9 Up and running!!!!

Shooter0423 commented 4 years ago

Update: I have been having intermittent connection problems. Most of the time the Bluetooth would connect but the trickler program and the scale would not report TRUE and the program would stay in a loop and never connect. I would cycle the power to the RPi and let the program start over. Generally after 2 or 3 tries it would connect and all would be good. I followed @cyclepath37 cable suggestion from above, (I did not replace the USB to micro USB adapter) and been starting and restarting over the last couple hours, probably 10 or 12 times by now. The RPi has connected everytime.

erichiggins commented 4 years ago

@Shooter0423 Interesting! Thanks for the update! I'll order one of these cables and try it out, then update the parts list. So happy that the community was able to find a great solution for this one!

Shooter0423 commented 4 years ago

@erichiggins I think the cable definitely fixed my connection issues. More starts and restarts today, working every time. I have the led code to monitor startup embedded in the Index.js file and the led's will even turn on in different orders as the program is retrying to establish connections. Interesting situation, if you forget to turn on the scale, the BT will connect, program and scale will report FALSE, turn on the scale and both will report TRUE and OpenTrickler is ready to roll. I need to post something about the edits to the code and layout on the proto-bonnet. A picture will not be very good, and a hand sketch probably worse, have any suggestions. And what to do with the modified files. ProtoBonnet1 Pic show a drv8825 stepper driver, i got that mostly working, not sure best place to activate the powder measurer, looking at the code in trickler.js where it starts the motor when the scale is zero for more than 1 second

Datakalu commented 4 years ago

I ordered the Cable Creations cable as well and I am no longer experiencing Bluetooth issues. So far it’s been 100% and connecting quickly. Thank you @cyclepath37 & @Shooter0423 !!! Moving forward and starting to build a Dandy style trickler for the system.

Shooter0423 commented 4 years ago

@Datakalu great news, haven't heard any news from @erichiggins about his experience with the new cable. We owe a bit of thanks to @cyclepath37. If you start a new thread about your trickler build, i'll post a couple pictures of a trickler I built out of gray pvc conduit connectors (iirc about $5 maybe $7) and eric's vibro-motor circuit

MrMr-No commented 4 years ago

I activate stepmotor only when I need need more then 30 grains

case (tickDelta > 1499): this.motor.speed = SPEEDS.VERY_FAST

... ....

drv8825 working very well :)

erichiggins commented 4 years ago

I ordered a new cable, but I'm out of town for work and won't get a chance to try it until tomorrow.

Thanks to everyone for sharing their feedback & suggestions, generally helping each other out and being awesome!

erichiggins commented 4 years ago

@Shooter0423 Two ways to share your code changes:

  1. You can create a public Gist here on GitHub. Very easy. https://gist.github.com/
  2. You can create a Pull Request to add your changes into the repo. I can review it, suggest changes, then merge it.

Don't hesitate to email me if you need some help.

Shooter0423 commented 4 years ago

@MrMr-No, great idea to put it in as another speed option. I have struggled to keep it from double throwing in shouldGo or startWhenReady. Are you setting up a function for the stepper code and calling it and are you using setIntervals or msleep/usleep. My coding skill with js is poor, any code you want to share will be greatly appreciated.

MrMr-No commented 4 years ago

From case i calling pythonshell cod and using python to run step motor. First check if requested weight is more then 30 grains then and scale is set to 0 .

case (tickDelta > 1499 && this.scale.weight === 0 ) :

  let {PythonShell} = require('python-shell')

PythonShell.run('/home/pi/projects/trickler/peripheral/lib/steper.py', null, function(err) { if (err) throw err console.log('finished stepper')

erichiggins commented 4 years ago

@cyclepath37 I got the new cable -- are you using it with the adapter, or just connected directly to the scale?

cyclepath37 commented 4 years ago

@erichiggins I use the null modem adapter, and I ended up getting a 90degree adapter also since i have my scale pushed up against the wall. StarTech.com Right Angle DB9 to DB9 Serial Cable Adapter Type 2 - M/F (GC99MFRA2) https://www.amazon.com/dp/B001S2PYV4/ref=cm_sw_r_cp_api_i_rVhqEbJXQ41NM 82D06728-983F-4016-BE3D-9331830155A9 I also wired in the push button from the dandy. This is allowing me to manually add one kernel if needed. I typically set the app to .02gr below my target. Had to adjust the values a bit since I am using a modified forster drop tube(long).

erichiggins commented 4 years ago

@cyclepath37 Great setup -- thanks for the photo!

erichiggins commented 4 years ago

I've had a chance to try the new cable and it worked great for me! I'll try doing a few rapid reboots today just to verify that it's more stable, but so far so good.

Passaita commented 4 years ago

Hello everyone, first of all thank you for moving this ahead. Really great addition to our hobby. I am waiting for my scale to be delivered and decided to pre-build trickler in advance. A couple attempts to build the code on raspbian using installation script failed (mostly due to my bad internet some packages wouldn't download) so I installed the image. After reading the thread looks like Bloetooth is getting more stable with certain cable. At the same time I am wondering:

I can contribute my 3D design skills to this project. Once my system is running I am planing to make a case for RPi and all the components. Anything else you were thinking about?

Shooter0423 commented 4 years ago

@Passaita welcome to the group. You are correct about the cable, definitely buy the cable @cyclepath37 suggested, im not sure if @erichiggins update the list of materials. The Bluetooth is very stable, the old cable was causing a connection error between the RPi and the scale, but the new cable seems to have resolved that problem. I'm in the process of testing an "auto-throw" feature using a Lee Deluxe Power Measure activated by a stepper motor contolled by the RPi. If you haven't built the expansion board for the RPi, i suggest that you use the proto bonnet that eric suggest, it make a very clean setup. The stepper drive I use will fit on the unused area if you keep the vibro control footprint kinda small. There is a pic in a post i made earlier to give an idea of the layout needed for the driver.

Passaita commented 4 years ago

I don't have a powder measure to play with and to be honest I am currently 3D designing powder trickler just for this project as I didn't have one. I know, I know, I am sorry, no comments :) Stepper motors are great and I used them in the 3D printer but the complexity with drivers scares me. Maybe because I have a lot of experience in RC planes and prefer servos I built controllers for my blinds at home using ESP8266 ESP-12 NodeMCU WeMos and servos without any additional drivers. This approach could be much simpler for others to follow and cheaper rather than stepper motors.

Passaita commented 4 years ago

My scale arrived today! Will try to connect everything tonight.

Passaita commented 4 years ago

My scale arrived today! Will try to connect everything tonight.

It works!!! As described above pin was changed from 15 to 12 and pre-built image works. Dispensing is way too slow but it is most likely because of my homemade trickler. Maybe pipe is too long, I made it so it can reach the center of the scale. Or vibro motor that I could source at a local shop isn't strong enough. Anyway even with really slow dispensing on the last stage of loading code doesn't pause long enough to wait for kernels to saddle down and this is typically causing an overload 0.02 - 0.04 grains. Another thing I have noticed (again this is mostly because of the pipe) on the fast stage of dispensing vibrations are causing kernels to almost plug the pipe. I manually added a couple grains and motor changed vibration frequency. This change made kernels move in the previously "plugged" pipe. So my suggestion would be to use various vibro modes for the fast stage.

Shooter0423 commented 4 years ago

@Passaita good to hear that thing worked well. I had some of the same issues with the trickler. I built a trickler out of parts on hand but did use the vibro motor listed in the BOM. I rewrote the portion of code that @erichiggins had developed. Eric had set me up a discussion thread for PWM control, I didn't have much success in that area but that thread might be a place to continue this discussion and keep this thread focused on installation. By the why, what powder are you using, i'm using Tac and Varget, a ball powder and a stick powder. You said the pipe may be to long, the pipe I built is 6" long made of the aluminum tube spec'd in the build list. My thought was the hole I drilled may be to big and causing the pipe to clog. And lastly, when you say it to slow, what amount of time are you referring, with Tac I get a charge at the target weight in 20 secs 95% of the time. I load in blocks of 100 as a match is 69 rnds or 88 rnds (20 rnds for record x3 or 4 and sighters as allowed) so if the throw is +/-0.02gr it gets used but put in the front row and get used for foulers or something not in the match.

Datakalu commented 4 years ago

2113FD5D-4D19-43A0-BE23-D77FD1D50156 I put together a knock off of a Dandy Trickler that when tuned to the powder with the dampening weight it will hit the target weight spot on every time with either ball or stick propellants. I’ll throw a bulk charge to within a 1/2 grain or so and I charge cases just about as quickly as I move the pan around. The system rocks, thank you all!!!!!!!

Passaita commented 4 years ago

@Passaita

There is following response from Datakalu and I want to say that I have made similar modifications. I have moved the motor instead of the weight and it gives different results on flow, speed and accuracy.

vibromove

Datakalu commented 4 years ago

Brilliant!

Shooter0423 commented 4 years ago

@Datakalu very nice looking trickler @Passaita same with yours Reloder 17 probably meters a lot like varget, I forgot to add in my earlier post that I throw the bulk of the charge to within 0.5gr with a powder measurer then let the trickler finish. If I where to try to trickler the entire charge (approx. 24 gr) it would take a long time. I'm thinking to get an efficient speed you need to throw the bulk of the charge and then trickle to the target.

erichiggins commented 4 years ago

Hey everyone! I've updated the instructions on the main README to reflect the work that was done here to use ready-to-flash images. I've also added links to two new images: production and dev.

Notable changes:

With that said, I think this ticket can finally be closed out. Please feel free to open a new ticket if you experience issues with the latest images!

erichiggins commented 4 years ago

Hey everyone! I created a Discord to make it easier for folks who are building an Open Trickler to chat with and support each other.

https://discord.gg/Bx3ynT

This invite link expires in 1 day to keep out spammers, but feel free to email me directly and I'd be happy to invite you!