• Skip to main content
  • Skip to primary sidebar

RNTLab.com

The Ultimate Shortcut to Learn Electronics and Programming with Open Source Hardware and Software

  • Courses
  • Forum
    • Forum
    • Ask Question
  • Shop
  • Account
  • Blog
  • Login

Unable to send 433MHz signal using code from Part 1 Module 4 Unit 3 (page 223)

Q&A Forum › Category: Arduino › Unable to send 433MHz signal using code from Part 1 Module 4 Unit 3 (page 223)
0 Vote Up Vote Down
Alan Brody asked 5 years ago

As far as I can see, the web server is working. However, when I click on a button on the web page, no data is being sent via the “mySwitch” code. I verified this both by the fact that the wireIess switch did not work, and the fact that I  could not see any results via the “ReceiveDemo_Advanced” example script.
I  do know that the “server.on” portion of the code is working because I inserted a debug line as seen below:
server.on(“/socket1On”, [](){
server.send(200, “text/html”, webPage);
mySwitch.sendTriState(socket1TriStateOn);
Serial.println(“test”);
delay(1000);
I have tried all possible values for the mySwitch.enableTransmit (x); statement. 
 
Any thoughts?
Thanks

7 Answers
0 Vote Up Vote Down
Sara Santos Staff answered 5 years ago

Hi Alan.
Are you sure your module is wired properly?
If the demo code is not working it can be one of the following scenarios: the module is not wired properly or it might be broken?
Were you able to use the module with other projects before?
Regards,
Sara

0 Vote Up Vote Down
Alan Brody answered 5 years ago

Yes I have checked both. I will switch modules and see what happens.
Thanks
 

0 Vote Up Vote Down
Sara Santos Staff answered 5 years ago

Ok.
It may probably be something wrong with the module.
Regards,
Sara

0 Vote Up Vote Down
Alan Brody answered 5 years ago

OK, making progress. I am getting output. The issue now is that the ESP8266 delivers a slightly different output than does the switch itself. Both have the same Tri-State value, but the PulseLength and raw data portions are different. The web generated output will not turn the switch on or off. Here is what I am seeing on the Serial Monitor:
 
From web page:
Decimal: 1332531 (24Bit) Binary: 000101000101010100110011 Tri-State: 0FF0FFFF0101 PulseLength: 350 microseconds Protocol: 1
Raw data: 10876,320,1084,320,1084,320,1080,1020,388,316,1084,1016,388,316,1084,316,1088,316,1088,1016,384,320,1084,1016,384,320,1084,1016,388,316,1084,1016,388,316,1084,320,1084,1016,388,1012,388,316,1088,312,1088,1020,384,1012,392,
From switch:
Decimal: 1332531 (24Bit) Binary: 000101000101010100110011 Tri-State: 0FF0FFFF0101 PulseLength: 185 microseconds Protocol: 1
Raw data: 5768,140,608,128,612,132,580,524,216,152,596,516,228,144,600,140,592,148,584,528,224,144,588,524,224,144,588,528,212,164,572,36,3420,28,2656,88,2540,48,600,32,24,64,48,28,148,232,76,300,64,
 
Can any of this besides the Tri-State value be changed by the Arduino code?

0 Vote Up Vote Down
Sara Santos Staff answered 5 years ago

Hi.
I don’t know why you are getting that issue.
But, there is an optional line of code that you can add to set the pulse length.
In this case, you want the pulse length to be 185. You can add it after the mySwitch.enableTransmit (x); statement. 

mySwitch.setPulseLength(185);

Let me know if this solves your issue.
Regards,
sara

0 Vote Up Vote Down
Alan Brody answered 5 years ago

That did it! Thanks for your help!

0 Vote Up Vote Down
Sara Santos Staff answered 5 years ago

Great!
I’ll mark this issue as resolved.
If you need further help, you just need to open a new question in our forum.
Regards,
Sara

Primary Sidebar

Login to Ask or Answer Questions

This Forum is private and it’s only available for members enrolled in our Courses.

Login »

Latest Course Updates

  • [eBook Updated] Learn Raspberry Pi Pico/Pico W with MicroPython eBook – Version 1.2 May 26, 2025
  • [New Edition] Build ESP32-CAM Projects eBook – 2nd Edition April 16, 2025

You must be logged in to view this content.

Contact Support - Refunds - Privacy - Terms - MakerAdvisor.com - Member Login

Copyright © 2013-2025 · RandomNerdTutorials.com · All Rights Reserved

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.