-
In theory, yes! I bought them at a cheap store here in Sweden quite some time ago so do't have a link for them, sorry. They are just some "noname" super cheap versions.
I noticed the spam in the receiver as well, haven't gotten that far yet though, got stuck experimenting with a gui on the touchscreen :)
-
Sure. A tiny disclaimer though, I don't know anything about this, I'm learning about microcontrollers as I go ;) Therefore, I might use the wrong terminology :)
My board is the HYSTM32 3.2". It's currently running the 1v41 of Espruino (if that matters).
I have two separate modules for RF signals, one receiver and one transmitter. Sorry for these links leading to a swedish shop, they can probably be found in other online stores as well (probably cheaper too).Any way.
I soldered some headers onto my board so that I easily can connect and disconnect stuff while learning about these things. I tried connecting the modules using a breadboard, but the antenna pin seems to act up when doing so. So I just use male-female connector wires from the transmitter into the board. Connected ground and power (3v3) and the data pin to A2.
I had found examples online to receive and transmit rf signals, but they were either for arduino or for raspberry pi. I ended up using the rc-switch library as a base.
The example TypeA_WithDIPSwitches_Lightweight seemed to be the easiest way to start. My cheap RF-plugs is using this setup, 5dip on the remote and 2x5 dip on the plug. This example is more or less directly translatable into Espruino. Though I tweaked it a little bit:
var thePin = A2; function send(numberHigh, numberLow) { digitalPulse(thePin, 1, 0.35 * numberHigh); digitalPulse(thePin, 0, 0.35 * numberLow); } function sendCode(code) { for (repeat=0; repeat < 6; repeat++) { for (i=4; i < 16; i++) { send(1, 3); if (((code << (i-4)) & 2048) > 0) { send(1, 3); } else { send(3, 1); } } send(1,31); } } function on() { sendCode(0b101010100010); } function off() { sendCode(0b101010100001); }
As my plugs and remote is set with the following system code:
1 2 3 4 5 on off on off on
and the plug in the above code has the following dips set:
a b c d e off on off off off
I therefore use the code 1010101000 and append 10 for turning on and 01 for turning off.
Theres a pretty good explanation on the rc-switch wikipages for how these plugs operate.
My next goal is to port the receiving code so that my rf-receiver can react to the remote that comes along with the plugs.
-
-
I've been "porting" an Arduino code example and been successfully converting it so far (not much to change other than removing the datatypes) and the code uses
delayMicroseconds
. Is there a similar way to achieve this in Espruino?The code is basically:
method() { digitalWrite(pin, 1); delayMicroseconds(350); digitalWrite(pin, 0); delayMicroseconds(350); }
-
Well...would be so bold as to call my mac "new", but thanks ;)
I figured as much. When I first connected the card my MBP would even recognize the card as a usb device (in either of the mini-usb ports), googled it and found someone with similar problems which led me to the Prolific drivers and installed them. After that there was a /dev/tty.usbserial but only if I connected it to the mini-usb by the power led not the other one. But flashing failed and gave some random error messages as seen by my previous posts.
After flashing the card on my ubuntu machine (thank god I saved it in my closet) my MBP has no problem finding it and connecting to it on either mini-usb port.
-
-
I've also gotten:
Reading data from espruino_1v41_hystm32_32_vc.bin Bootloader version 0x22 Chip id 0x414, STM32F1, performance, high-density Writing 208084 bytes to start address 0x8000000 Write 256 bytes at 0x8000000 Traceback (most recent call last): File "stm32loader.py", line 513, in cmd.writeMemory(conf['address'], data) File "stm32loader.py", line 348, in writeMemory self.cmdWriteMemory(addr, data[offs:offs+256]) File "stm32loader.py", line 221, in cmdWriteMemory self._wait_for_ack("0x31 programming failed") File "stm32loader.py", line 87, in _wait_for_ack raise CmdException("No response to %s" % info) __main__.CmdException: No response to 0x31 programming failed
:D
-
Yep, first time running again:
Reading data from espruino_1v41_hystm32_32_vc.bin Bootloader version 0x22 Traceback (most recent call last): File "stm32loader.py", line 493, in chip_id = cmd.cmdGetID() File "stm32loader.py", line 163, in cmdGetID if self.cmdGeneric(0x02): File "stm32loader.py", line 136, in cmdGeneric return self._wait_for_ack(hex(cmd)) File "stm32loader.py", line 97, in _wait_for_ack raise CmdException("Chip replied with a NACK during %s" % info) __main__.CmdException: Chip replied with a NACK during 0x2
Running it again:
Reading data from espruino_1v41_hystm32_32_vc.bin Bootloader version 0x22 Chip id 0x414, STM32F1, performance, high-density Traceback (most recent call last): File "stm32loader.py", line 508, in cmd.cmdEraseMemory() File "stm32loader.py", line 242, in cmdEraseMemory self._wait_for_ack("0x43 erasing failed") File "stm32loader.py", line 87, in _wait_for_ack raise CmdException("No response to %s" % info) __main__.CmdException: No response to 0x43 erasing failed
running it a third time puts it back to the first message
Chip replied with a NACK during 0x43
-
After 2(!) months waiting for my HY 3.2" boards to arrive I finally get to try espruino \o/
Though on connecting it and flashing it I get an error! /o\
python stm32loader.py -p /dev/tty.usbserial -evw espruino_1v41_hystm32_32_vc.bin Reading data from espruino_1v41_hystm32_32_vc.bin Bootloader version 0x22 Chip id 0x414, STM32F1, performance, high-density Writing 208084 bytes to start address 0x8000000 Write 256 bytes at 0x8000000 Traceback (most recent call last): File "stm32loader.py", line 513, in cmd.writeMemory(conf['address'], data) File "stm32loader.py", line 348, in writeMemory self.cmdWriteMemory(addr, data[offs:offs+256]) File "stm32loader.py", line 211, in cmdWriteMemory self._wait_for_ack("0x31 address failed") File "stm32loader.py", line 87, in _wait_for_ack raise CmdException("No response to %s" % info) __main__.CmdException: No response to 0x31 address failed
I running this on a MacBook Pro (around early 2010 model) with mavericks.
Connecting it to the mac keyboard usb hub instead I got this error message:python stm32loader.py -p /dev/tty.usbserial -evw espruino_1v41_hystm32_32_vc.bin Reading data from espruino_1v41_hystm32_32_vc.bin Bootloader version 0x22 Chip id 0x414, STM32F1, performance, high-density Traceback (most recent call last): File "stm32loader.py", line 508, in cmd.cmdEraseMemory() File "stm32loader.py", line 228, in cmdEraseMemory if self.cmdGeneric(0x43): File "stm32loader.py", line 136, in cmdGeneric return self._wait_for_ack(hex(cmd)) File "stm32loader.py", line 97, in _wait_for_ack raise CmdException("Chip replied with a NACK during %s" % info) __main__.CmdException: Chip replied with a NACK during 0x43
I must be doing something wrong or have missed doing something. I've been following the guide at: http://www.espruino.com/Serial+Bootloader
On my board there's a button for boot0 and reset, when I press them the board shows a white screen and seems to be put in bootloader mode (as pressing the reset, resets the device and shows the demo program).
I have the 3.2" version and I have no real problems. Had some inital flashing problems, but they were related to my laptop and not the card itself apparently. Haven't tried anything with the sdcard or rtc (it came without a battery for this and I haven't had time ti fix one yet), but the LCD works just fine. It's usper easy to draw and write stuf on it. The touch callback stuff feels a bit wonky to me, but I just use the example Gordon has on the page and that works sufficiently enough for my uses.