NodeMCU/ESP8266 with 2 relays doesn't work [migrated] - esp8266

This question was migrated from Stack Overflow because it can be answered on Electrical Engineering Stack Exchange.
Migrated 9 days ago.
I have the schematics below in which one of the relays work fine but the other doesn't, from design perspective they are the same!
The relay at the bottom is the one that is not working:
And this is the board layout:
I replaced the relay but it still doesn't work - all components are new.
Measured the output of the nodeMCU and it reports 3.x Volt which seems fine to me.
The code is not the problem as it works with the ready relay module connected to the nodemcu similar to this one:
Relay module
Please help in case you can see a problem in the board/schematics.

I think the transistor pinout is wrong, 2N3904 are emitter, base, collector but looks like you have base collector emitter.

Related

Segfault when simulating control loop with second order system

Working from the tutorials I wanted to try PID-controlling a second order linear system. I'm running into segfaults when simulating the closed loop. I've put my code over on Gist. It is mostly identical to the example in the dynamical systems tutorial.
Here's what works
Simulating a diagram containing only the second order system
Dropping in PendulumPlant for the second order system and using the controller
Every step up to simulator.AdvanceTo - that's where the segfault occurs
I'm sure I am missing something obvious here. Does anyone with more experience see what's wrong?
Thanks for reporting this. I didn't see anything on quick inspection. I ran your code (both on linux and mac) and was able to reproduce. Absolutely you should never see a silent segfault, so this is a real issue.
I've escalated it here: https://github.com/RobotLocomotion/drake/issues/12497
FTR - I've also opened a PR to improve the PidController documentation. https://github.com/robotlocomotion/drake/pull/12496
I'm investigating this now -- I've also successfully reproduced the bug locally using the provided python, but I've also reproduced it directly in C++. [Reproduced in now defunct branch]
I'll update when I have something concrete.
Update 1: You've got an algebraic loop in these two systems (one that does not exist for the PendulumPlant as its derivatives and output are expressed in terms of its state and not its inputs). In this case, both systems' outputs depend directly on their inputs so, kablooie! The bug, in this case, is figuring out why that isn't communicated to you right up front.
Presumably, you'd also like to know what the right version of this program is that doesn't have an algebraic loop. Stay tuned.
Final update
A patch has gone through to correct the underlying bug. Depending on how you're accessing Drake, it's immediately available in master, or you can wait for the next binary (as to your taste).
Thanks for bringing this issue to our attention.

How to run chrome browser in grid using windows as hub and mac and ipad as nodes?

Hub: Windows 64-bit Nod: Mac/Ipad
I'm looking to automate chrome browser in mac and ipad and add to our selenium grid running on windows, c# scripts. Please advise. And also if appium is required and does it have to run the server on a mac for the ios testing?
*I'm modeling my question after the link below as clearly others have been able to convey the question just fine, yet every time I've asked I've been flagged as not asking properly, and now there's a notice threatening to block me? Mystified as to why I'm receiving different treatment, please explain how this is not clear and allow for commenting. Isn't that what comments are for anyways?
update due to lack of comment status
Please note my follow up question on Appium with a narrower scope: is appium is required and does it have to run the server on a mac for the ios testing? Y/N- That doesn't get any narrower. Plus I can't run code and get errors without having the correct tools setup. Otherwise there is little documentation available on this out there, and what there is is either not great or older, and all are running java code on the mac which is not the .net windows setup we have. Even though the rules may have changed, clearly breadth isn't an issue as people seem to understood other broad questions just fine. I've done several days of research on this.
How to run chrome browser in grid using MAC as hub and Windows as Nod?
**Obviously this has been hashed before
Why is Stack Overflow so negative of late?. I would add downvoting and not answering questions no matter how noob kinda goes against the very core mission answer sites have--answering questions. If this site won't, some other site will.
Let me try to Answer your Questions one by one :
I'm looking to automate chrome browser in mac and ipad and add to our selenium grid running on windows, c# scripts. Please advise. : Questions asking us to recommend or find a book, tool, software library, tutorial or other off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
If appium is required and does it have to run the server on a mac for the ios testing : Automating Web Application requires only Selenium. If you are automating Mobile Application you have to go with Appium.
Every time I've asked I've been flagged as not asking properly, and now there's a notice threatening to block me? Mystified as to why I'm receiving different treatment : Answer is same as #JeffC mentioned in his comment Your question is way too broad and doesn't show any research. The question you linked is from 2013 and the rules were different back then. Do some research and try to accomplish what you are asking. If you run into an issue, research that specific issue and see if you can overcome it. If you can't, come back and ask a question around that specific issue with supporting information, research, code, samples, etc. and we can help you. As it current stands, your question will get closed for being too broad.
Is appium is required and does it have to run the server on a mac for the ios testing? : Appium is required and you can run it on your Desktop/Local Systsem as well.
I can't run code and get errors without having the correct tools setup : Every Automation Engineer starts with a similar situation. So you are on the right track.
There is little documentation available on this out there, and what there is is either not great or older : Help us (stackoverflow.com) to prepare more documentation.
I've done several days of research on this How to run chrome browser in grid using MAC as hub and Windows as Nod? : The question was raised as early as Jul 9 '13 at 14:19. Almost half a decade back. By now you should have made your hands dirty with Hard Disk full of Code
Obviously this has been hashed before Why is Stack Overflow so negative of late? : If you have any concern feel free to raise it at StackOverflow - Meta
Solution
It is never late to start anything new. Start writing your code. Get your fingers dirty. Feel free to raise any Technical Question where you get stuck. StackOverflow volunteers will be happy to help you out.

My window content disappears after a few seconds

I programmed with DirectX 9 / OpenGL and C++ some years ago and I wanted to start a new hobby project with SharpDX and DirectX 11. I made the first basic steps and everything looks nice, but I only the opened my application and saw, that everything's as expected and closed them afterwards.
Today, my application was opened for about 20 seconds and suddenly my whole window content disappeared. I checked the official SharpDX samples and I had the same problem with the official MiniTri sample from SharpDX. Finally, I tested the offical samples from Microsoft in Microsoft DirectX SDK (June 2010)'s Direct3D11 Tutorial 02, which does nothing more than showing a colored triangle. Even the official sample from Microsoft (which does neither use SharpDX nor C#) has the same issue on my computer. Of course, I used my favored search engine for quite some time, but I was not able to find anyone with the same issue. Maybe I searched for the wrong keywords.
After around 14-20 seconds, the content (i.e. vertices) of the window disappear. I have no rotation, animation, movement or anything, just simple triangles with a simple color.
I'd be very happy, if you can help me!
I spent several hours to figure out, why some simple official SharpDX and DirectX tutorials do not work correctly on my machine. Finally, I decided to ignore that issue and contine with the development of my game. It was a great decision since it turned out, that I don't have any issue with the advanced tutorials! The MultiCube sample from SharpDX worked very well and its content did not disappear. So, I figured out that my problem does not occur, if my graphics card is kept busy. I continued my development while running Fallout 4 minimized in the background. Developing this way, my content did not disappear.
I started to implement a user interface for my game using Direct2D1 (with SharpDX). It turned out that using Direct2D1 solves my issue and the content stopped to disappear.
I am not absolutely sure what caused my issue, but apparently my GPU got bored and stopped rendering my simple primitives. :-D Using Direct2D1 for UI solves this problem anyhow.

bluetooth communication in nxj

I'm nxj beginner.
I have some questions about bluetooth communication between PC and brick.
First, when bluetooth communication occurs, where is the birthplace processing this datas?
In other words, I want to know whether these datas will be processed on CPU or brick.
Second, what is exact roles CPU and brick in bluethooth communication?
That means what is processed on CPU and what is processed on brick.
I have searched almost web site but I can't find this anywhere.
Please help me. Thanks.
You can see it in the package structure.
lejos.nxt.*
This package contains classes running on the NXT-brick. All code in this package will be compiled for the brick and will run on the brick.
lejos.pc.*
Here the difference is not that clear. This is java-code you compile for personal computer. So most code runs on your computer. But some classes (e.g: RemoteMotorController) only send messages to the NXT-brick which gives commands to the motors.
lejos.pc.comm provides API's that allow you to communicate/control the nxt robot from the PC.
When importing the the libs to an Android project, it allows you to build an instance of the same environment used on a pc, but within android.
I agree it can be tough finding some things out. It would be great if there was as stronger lejos presence on SO
This question is months old and has remained un-answered I actually have a lot of questions about it myself, but I might be able to provide some insight for utter novices.
when using bluetooth with Android and NXJ robots, you use either lejos.pc.comm or lejos.NXJ.
Both provide APi's to do almost the same thing, but work a little differently. I don't know nearly enough about the NXJ api, but I do know that it is the one that lets you manipulate the robot much more effectively, such as outputting data to it's LCD screen, which you can't do with the pc.comm api
As far as I can tell, the pc.comm API uses both Android Bluetooth API's and it's own protocols to allow communication with Lego LCP commands.
(I want to come back to this, but I'm writing a dissert on the topic so I'll try to update it in a couple of days. Seems not many are interested though, shame)

Erlang bindings for CUDA or OpenCL

I have found this post on Erlang and CUDA, it is rather old so I would like to learn if something has changed since this question was posted. I would like to know if there is any implementation of CUDA/OPENCL bindings for Erlang?
In general, I investigate if it is possible to scale ERLANG program vertically to GPU using CUDA/OPENCL to process a data stream.
OpenCL is here: https://github.com/tonyrog/cl
(You should use the nif branch if that isn't merged to master yet)
I'd wait for this talk http://erlang-factory.com/conference/SFBay2011/speakers/KevinSmith (they will upload video & slides after the conference)
I gave the talk Yurii mentioned and I'm not sure when the videos will be available. The code I demoed is available here: http://github.com/kevsmith/pteracuda. It's minimal but should illustrate what's possible with CUDA and NIFs. I'm hoping to improve it further once my machine arrives back home from SF.
You should also look at https://github.com/vascokk/NumEr
I've been using bit from both this project and Smith's project.

Resources