I have a VMA354 that should connect my Arduino to the internet and use the Tuya app. I hooked it up to the arduino and loaded the test software provided on gifthub. That works so my arduino can communicate with the module. However I can find nowhere how to connect the module to the wifi.
This module uses serial communication via i2C, all the wifi and ethernet libraries for the arduino use SPI interface, so using them did not help me.
Check the serial connection. Make sure that TX of Tuya board is connected to RX (PIN 2) of Arduino,
and RX of Tuya board is connected to TX (PIN3) of Arduino board.
NOTE:
Recommended RX,TX => use pin 2 and pin 3 of arduino! Make sure it’s not connected to the TX,RX pin 1 and 2 of arduino!
See below the pin assignments for Arduino Mega as well.
* Connections:
* VMA354 Arduino UNO Arduino MEGA
* VCC 5V 5V
* GND GND GND
* TX RX (pin2) RX1 (pin19)
* RX TX (pin3) TX1 (pin18)
*/
//libraries
#include "Tuyav.h"
#include "global.h"
//selection of Serial port
#if defined(ARDUINO_AVR_UNO) //Arduino UNO board: use SoftwareSerial with pins you select, see https://www.arduino.cc/en/Reference/softwareSerial
SoftwareSerial mySWserial(2,3); //RX,TX (2 and 3 are recommended)
Open the TuyaSmart app, and add a device.
Follow the wizard. Connect Your phone or tabled with Your Wireless router, and give in Your SSID and password. Now, push and hold the button on “Tuya board” (VMA354) for 5 seconds, till the RED LED flashes. Then confirm if the led blinks in the wizard. The app will now searching for Tuya boards (devices). If there’s found one, it will be added to Your Wifi network.
I bought a VMA354 Tuya IoT Interface module to connect an Arduino UNO to the Tuya Cloud. I cannot test it because all the examples given in the Tuyav librarie (Tuyav-master) exceed the Arduino UNO memory space. Space for data is 2048 and the space used by the examples are always > 2048.
It is mentionned is the documentation that an Arduino UNO can be used, and in the code itself the wiring to connect an Arduino UNO is provided.
Could you tell me how to use this VMA354 module with an Arduino UNO please ?
I’m using the module with al lot of fun now, but one problem remains, if I switch the module from wifi network (i’m using it on a boat) I need to use the tedious setup procedure to change the wifi SSID and password. Is there a method to pass this to the module via the arduino software? I looked in de library and there seems to be such a thing for test mode?
Great that you have added the sample software for the weather function! Works nice.
Unfortunately, the only official way to connect the TUYA module with a Wifi network is via the Tuya app.
So indeed, every time you want to connect to another wifi, you will need to re-add the module in the Tuya app on the new network.
There are some experimental features in the library to use fixed settings, but we didn’t get them to work properly, so I would not advice it.
It works, thanks ! Is it possible to split the pairing part and the basic_IO_example part to avoid the space (memory) problem? Or perhaps to migrate to a D1 Wemos (lolin) esp8266-12F with a lot of storage? The code looks fairly complex…
Funny, TinyTuya (on a Raspberry Pi Zero W) shows a lot of DPS values via a dictionary command
Regards, Bert
Glad to hear you got it working.
The Tuyav library uses a lot of background Tuya communication, so it’s using a lot of memory. The basic_IO_example uses (almost) all of that background communication, so not a lot of use to split it.
We have tested the Tuyav library with ATmega chipsets and AVR platforming.
Version 1.1 used to work on an Arduino UNO, version 1.2 no longer has enough memory (using 132% of the Arduino UNO’s dynamic memory). We have therefore switched to the Arduino Nano Every board. With no other libraries, the Tuyav uses 39% of the dynamic memory, leaving 3707 bytes for local variables.
You can also use the Aruino Mega Board (Tuyav uses 33% of dynamic memory, leaving 5436 bytes for local variables).
So, you either use the version 1.1 of the Tuyav on the Arduino UNO, or you swith to the Nano Every/Mega.
We have not planned to port the Tuyav library to ESP boards. Would be a bit strange since the Tuya chip itself is basically a ESP board ;-).
Thank you for the answer. Noticed a statement: in release 1.1 the pairing was moved to the Tuya module, so indeed, almost nothing to save by a split. The Arduino Nano Every board is reasonably priced. A serial interface sounds simple, but impressive libaries, a combination of Tuya code and Velleman’s work, I guess.
I have a network with sensors connected to esp8266/esp32 devices interfacing via EspNow, which explains the idea to propose to connect an esp directly with the Whadda Tuya module
Velleman-Whadda should write an article about the module in Elektor. Probably are more people interested in this board. I was lucky to find it, while searching for other things
Hi,
I bought 2 modules form Conrad (sold as WPI354 but there is VMA354 on the board).
When I try to enter pairing mode (hold button for 5 second) no LED is flashing.
Is it another way to enter pairing mode?
The board is powered from 5V power source, current consumption is about 70-80 mA.
Thanks in advance
Rafal
SOLVED: module enter pair mode after “tuyav.initialize();” called from Arduino UNO.