mtu-most / linear-actuator

Code and model files for open source linear actuator
26 stars 19 forks source link

Pump Server Not Sending Signal to Stepper Driver #7

Closed NickRothbacher closed 8 years ago

NickRothbacher commented 9 years ago

Dear All,

I hope that this is the correct place to look for help with this program, if not I apologize. As far as I can tell, everything in my setup functions correctly except for the part that actually sends a signal to the driver. The webpage looks correct and I can move the motor using a simple program of my own devising, but clicking the push button doesn't send any signals to the driver. Is it possible that I have the configuration of the pump-server wrong somehow?

Thanks, Nick.

wijnen commented 9 years ago

Hi Nick,

you are in the right place. I would need a little more information to help you. Your own simple program drives the gpio pins directly? What configuration did you use? If you know Python, you may check how the server differs from your own program.

A final note: I've noticed that not all browsers support websockets (or at least not the way I implemented them). You may want to try a different browser to see if that helps.

If you can't figure it out, can you post a screenshot of the website?

Thanks, Bas

NickRothbacher commented 9 years ago

Hi Bas,

My program currently does basically the same process as the move method in pump-server, except that it simply uses time.sleep(0.002) instead of your busy wait method. It also just loops through 500 times instead of a calculated number of times.

I added a couple text print lines to the javascript file and the python file and the javascript text outputs while the python one does not. I'm not an expert in python so it might be that I did the text output wrong, but I hope that information helps.

I'm currently using chrome for my web browser. I tried Safari but it gave me a lost connection to the server error. I can install another or try a different OS if you think it would help.

This is what I'm seeing for the website: Here's a picture of the website I'm seeing.

Thanks for your help, Nick.

wijnen commented 9 years ago

On Wed, Jul 01, 2015 at 09:47:56AM -0700, NickRothbacher wrote:

This is what I'm seeing for the website:

Yes, that is a failed websocket connection. The '-' on the first 3 lines should be numbers instead. Can you try connecting with Firefox? That's what I use for testing.

You can also add "tls = False" as an argument to the Server constructor at the end of pump-server. If you do that, you must use http:// instead of https://.

Thanks, Bas

NickRothbacher commented 9 years ago

I tried connecting in Firefox and I'm getting a connection time out now.

Thanks, Nick.

wijnen commented 9 years ago

On Thu, Jul 02, 2015 at 10:50:09AM -0700, NickRothbacher wrote:

I tried connecting in Firefox and I'm getting a connection time out now.

Can you explain in detail what you're doing, and what you see at every step? Copying all text in the terminal window would be helpful.

Thanks, Bas

NickRothbacher commented 9 years ago

The steps I take:

I'm actually receiving a new error I haven't gotten before, an "unable to connect". Then, when I try

sudo service pump-server restart

I get the warning "failed to kill 1874: no such process" (with a different process number each time) and a failed! message.

Thanks, Nick.

wijnen commented 9 years ago

Ok, that helps. Please log into the Pi as root, run

service pump-server stop pump-server

It will probably give you an error message. I'd like to know what that is. If it doesn't try to connect with a browser and see if it gives an error message then.

Thanks, Bas

NickRothbacher commented 9 years ago

Ok so I can connect to the server in Firefox, but when I do the Raspberry displays the message:

Error reading from socket: [Errno 1] _ssl.c:1415" error:14094418:SSL routines:SSL3_READ_BYTES:tlsv1 alert unknown ca

then the message

not serving unknown extension ico

I hope that helps.

Thanks, Nick.

wijnen commented 9 years ago

These messages are all normal, and no reason that anything shouldn't work. So to be clear: does it still not work?

If it doesn't, can you install firebug, enable its console and see if the page reports any errors?

Thanks, Bas

NickRothbacher commented 9 years ago

Yes, it is not working. I installed firebug and the only error I am getting is "uncaught exception: out of memory". Is there some way to increase the memory allocated to the server?

Thanks, Nick,

wijnen commented 9 years ago

Hmm, I have seen that happen as well; I don't know what that problem is, but it's in Firebug, it seems. In any case, that problem doesn't seem to cause anything to break for me, so I think you can ignore it. However, it means firebug is unusable.

Firefox also has a builtin console; can you look at that and reload the page? You can find it in the menu, which you can make appear by pressing the alt key, then Tools->Web Developer->Web Console.

I've seen the out of memory message there as well, but it doesn't cause it to stop working.

Thanks, Bas

NickRothbacher commented 9 years ago

I'm seeing a warning about the certificate being insecure a lot, but no other errors are showing up in the web console. Anywhere else I should look?

Thanks, Nick.

wijnen commented 8 years ago

Hi,

I have finally gotten around to installing this on a Pi again here to see if it worked. Because of other recent changes, I had to change it to Python3. Anyway, perhaps some other fix I made in the mean time helped, but in any case it works here. Can you confirm that if you run apt-get clean; apt-get update; apt-get upgrade; apt-get install --reinstall pump-server that it works for you as well? (You need to reinstall because I'm bad with version numbers, so it may not detect that the version you have is old; if the upgrade installs new version of pump-server, you don't need to reinstall it.)

NickRothbacher commented 8 years ago

Hi Bas,

Thank you for all your help but I am unfortunately no longer working with the system we discussed this summer. I also did end up writing my own control program since the project I was working on was hoping to use more real time control methods than the ones afforded by a web based interface. I apologize for not letting you know but I completely forgot about this issue thread. I will close it now since it seems like its working on your end.

Thanks again for everything, Nick

wijnen commented 8 years ago

Ok, thanks. I'm mostly using an Arduino myself as well, which is why it took me so long to respond. But I like to keep this working for people who want a simpler solution with less hardware.

JeroenVanStappen commented 7 years ago

Dear Bas,

I have a similar problem as Nick had. I was using chrome as well, but on firefox I have similar issues. Just like Nick, I am able to connect to the server, but on the webpage, the server also has "-" instead of numbers. I have looked up the web console on firefox and it gives following error: "Rpc is not defined". Also, this is one of the errors which I get on the Terminal (rpc.js not found).

Do you happen to know how to solve this.

Thanks in advance... I would be thrilled if I get the stepper motor to work.

Best regards, Jeroen.

wijnen commented 6 years ago

Hi again,

Sorry for leaving this open for so long. Thanks for the error message. The problem is that you need to copy rpc.js from the python-websocketd package into the directory with the server program.

I hope that helps.

Thanks, Bas