Doubts to flash NodeMCU + Garden Project

Sorry, now already updated.

I have the code in the Atom project saved as text. Then I click with right mouse button and I try to run giving above mentioned error.

I am a total rockie in this matter, I’m lost.

It was still wrong, you used apostrophes instead of backticks. I’ve fixed if for you now, but you need to figure it out for the future.

You need to replace:

IPAddress server_ip (blynk-cloud.com);

with

const char server_ip [] =   "blynk-cloud.com";

If you’re a rookie then I’d suggest that you drop the ATOM IDE and go for the Arduino IDE instead. It’s what the vast majority of community members use you’ll find it much easier to get community support that way.

I’m still confused about why you don’t just set-up your router to have a small range of DHCP addresses and get up and running that way.

Pete.

The reason to use static ip’s is because I have all my devices with static ip including my NAS.
I bought a sonoff ch4 pro in order to do a irrigation system. I already have it ready to flash new firmware which should be in BIN extension.
I copy one of the above projects and I added just the ip lines to make it static. I used Atom to do that. Now once finished I think I have to compile it in order to use it to flash the sonoff, but I am doing something wrong or I missed some step.
I am trying to find it in google but I was not able to find all steps to compile above text.
If someone can support me or can tell me where to find more info I will appreciate.

Hi Pete. Finally I did. I used Arduino IDE with one sketch posted here. I selected my board ESP8266 and I compiled. Tomorrow I will try to flash my sonoff and I will test it.

Thks a lot, I was try Atom when sketch is wonderful and easier.

I will let you know final result.

1 Like

Hello. I don’t know the reason but my sonoff CH4 Pro is well flashed at 100% but when I try to star it, it do a knock noise and blue light doent star. Maybe I did something wrong.

I am thinking to buy a Arduino board and some relays. Any special brand/model to work with this sketch?

Thks

Did you flash it in the correct mode?
Is it connecting to your wi-fi and Blynk server?
What serial output are you getting?

If you’re going for different hardware (I’d stick with getting the Sonoff working if I were you) then before you rush out and buy an Arduino you should read this:

Pete.

Thks for your help I am thinking this set

The problem with sonoff is you have to trick it and maybe I did something wrong.

Did you read the link I gave you?
Do you realise that the product you’re thinking of buying has no wired or wireless internet connection capability as it stands?

Vyou do t have to “trick” the Sonoff, you have to replace the existing firmware with your own firmware, by uploading a new sketch to it. This is exactly the same as you would have to do with any other device you chose to use.

If you’re not happy to answer questions on what flash settings you used, whether the device is connecting to Blynk and what serial output you’re getting then I’ll step back and let you do your own thing.

Pete.

Hi Pete. I read your link. Interesting. The problem of sonoff is that you hace to weld some cable in the chip and I don’t know I did property. Arduino IDE confirm 100% flashing but when I connect sonoff is not doing anything.
This is the reason why I am thing to buy an Arduino board with WiFi + relays in otprder to connect my garden irrigation Solenoid and control it from my mobile.
I think I replied all your question.

You shouldn’t need to be soldering anything to the chip, just soldering-in the FTDI headers and finding the correct location to pull GPIO0 to earth while you’re powering it up.
If you hadn’t done it correctly from a hardware point of view then it wouldn’t flash to 100%.

What’s more likely is that you’ve chosen the wrong settings in the Arduino IDE.

I’ve asked twice, but I don’t see any info about the flash settings you used in the Arduino IDE, whether it’s connecting to Blynk or what output you’re getting in the Arduino IDE serial monitor, but don’t worry, I wont bother asking again.

In which case you’ll need to modify the sketch, and use SoftwareSerial to connect your Arduino and Wi-Fi modem.

Good luck.

Pete.

Hi Pete.

Finally I am not able to flash sonoff. Something happened at hardware level because now I cannot connect it again to my computer. No lights on. I think it died.

Then now I will go for Arduino which is easier to flash. I read your link about boards and due to my inexperience soldering, i am thinking to buy following board. What do you think?

Imgur

My idea is to use the sketch from this link

From Hagay or Arizona users. Hagay used sonoff then I supposed I will need to change something in the sketch.

I will read more to make less questions.

Thks a lot for your support and sorry for bordering you.

It’s overpriced, but a much better choice than the Arduino Uno.

Pete.

Thks a lot Pete. I know but it is in my house in 1 day.

Which board I should select in Arduino IDE?

Thks again.

From the Amazon.es screenshot, it looks like a NodeMCU 1.0

Pete.

1 Like

Yes it seems

Already flashed and running well. It connects to internet and I can manage. The only doubt is how to change the time to Madrid one. Also when lights are on means the relay is closed and then the spark will be irrigating?

RTC widget.

Not quite sure what “spark” means, but it depends on whether your relays are active HIGH or active LOW.

Pete.

1 Like

In the code I have LOW. Maybe the problem is that the relays need 5V and the board only gives 3.3V. Here you have instructions

  • This relay module is 5V active low. Relay output maximum contact is AC250V 10A and DC30V 10A.
  • Standard interface can be directly connected with microcontrollers.
  • Working status indicator lights are conducive to the safe use
  • 4-channel relay interface board, which can be controlled directly by a wide range of microcontrollers such as Arduino, AVR, PIC, ARM, PLC, etc. It is also able to control various appliances and other equipments with large current.
  • Widely used for all MCU control, industrial sector, PLC control, smart home control.

4-channel relay output modules, relay output contacts 250A 10A.
Input IN1, IN2, IN3, IN4, the signal line LOW effective.
VCC, GND power input, can relay a separate power supply relay power input of JD-VCC.

It is possible to give it 5.5V using below pins but I am not sure how to do it.

If someone can help me.

How are you powering the relay board?

What pins on the NodeMCU are you using to connect to pins 1,2,3 and 4 on the relay board (refer to the pins by the D letters printed on the NodeMCU).

What pins have you specified in the code, and how have you referenced them in the code (by D number or by GPIO number)?

How are you powering the NodeMCU, and what are you doing with the ground connections?

Pete.

´´´
How are you powering the relay board?
´´´
I’m using the NodeMCU board power as explained below. Then as relay needs 5V I need to use 5V power adaptor to the Relay board using above picture pins.

‘’’
What pins on the NodeMCU are you using to connect to pins 1,2,3 and 4 on the relay board (refer to the pins by the D letters printed on the NodeMCU).
What pins have you specified in the code, and how have you referenced them in the code (by D number or by GPIO number)?
‘’’
I connected adapting the GPIO pins to NodeMCU, for example if in the code was used the ping 14 and 12, then I used the NodeMCU pins D5 and D6. Each time I click buttons in the blynk app the relay is working. I also connected the GND from the relay board to the GND in the NodeMCU board close to D5 pin. also I connected the VCC from the relay board to the 3.3V close to the pin D4.

‘’’
How are you powering the NodeMCU, and what are you doing with the ground connections?
‘’’
For the NodeMCU board I was using a 5V mobile power adaptor but I will need to change to a 3.3V in order to don’t damage the board which is 3.3V