Mount NodeMCU with Micropython filesystem? - nodemcu

I've recently bought a NodeMCU board and flashed Micropython in it.
I've read about the boot.py and main.py scripts, but I can't understand how to access them. I have succesfully connected to the Python REPL with the screen command and everything works fine.
Is there a way to mount it as an external drive on Mac OS X? Because I haven't found a way till now.
Thanks in advance!

you can enable the webrepl and upload via that
I've found this one package very helpful to upload vi the serial.
pip install mpfshell
python -m mp.mpfshell
> open COM3
> put main.py
micropython is cool...

Due to some questions I had about the NodeMcu and running Python on it, I just set up a pretty end-to-end documentation python2nodemcu on GitHub.
Viewing, downloading, uploading or listing files of the MicroPython filesystem has its own section there.
It utilizes Ampy, a Python library to connect to the MicroPython-based board via its serial connection. For listing all files for example, simply run python3 ampy/cli.py --port /dev/tty.{device-file} --baud 115200 ls.

The mpy-utils software package contains a tool called mpy-fuse that allows you to mount a MicroPython device from Linux or MacOS using FUSE. I found this tool through this video that describes how to set it up and shows how it looks like in action.

Related

What is the function of uiautomator apks present on the python wrapper for uiautomator 2

I am trying to read and understand how python wrapper for uiautomator2 works. What is the function of uiautomator apks present inside libs and how does this whole framework work?
Also, where did they come from? I could not find source code of these apks.
https://github.com/openatx/uiautomator2
uiautomator apk are there to handle ui commands on phone.
python-uiautomator2 is a python-wrapper, which allows
scripting with Python on computer
controlling the mobile with computer with/without usb connection
screen-casting exact
Real time device controlling
Installation
Connect ONLY ONE mobile to the computer with developer-mode open,
make sure adb devices works
Install packages: pip3 install -U uiautomator2 weditor
Install daemons to the mobile: python/python3 -m uiautomator2 init
The weditor is a standalone web-server to interact with the mobile through browser.
Basic Usage
Connection
Connect the mobile by wifi and run below python script
import uiautomator2 as u2
d = u2.connect('192.168.31.37')
print(d.info)
(or)
Connect the mobile by USB and run below python script
import uiautomator2 as u2
d = u2.connect('mobile-serial') # get from "adb devices"
print(d.info)
Key events
d.screen_on()
d.screen_off()
d.press('home')
d.press('back')
for full details please follow the below link
uiautomator2 doc

Nodemcu ESP8266 12-F storage

I have just started working with my Nodemcu and was wondering when you upload codes using Arduino IDE on the device, how can you delete them from the storage?
Would highly appreciate any clues.
Many thanks.
Tried a variety of methods and the following worked:
You must have python installed.
install the esptool package using pip.
esptool.py --chip esp8266 --port (write the port location esp connected) erase_flash
run 3 in terminal
storage is emptied successfully.

Can't run Fuchsia components with shell

So I am trying to get started developing on Fuchsia and I wanted to get the hello world component to run. However, following these steps doesn't work for me. I'm using core.qemu-x64 running on an Ubuntu 20.04 VM with Virtual Box. I have gotten the emulator to run with fx qemu -N but fx vdl start -N hasn't worked for me.
I run fx serve-updates but it just outputs "Discovery..." and never changes. Then I try to run fx shell run fuchsia-pkg://fuchsia.com/hello-world-cpp#meta/hello-world-cpp.cmx but it says "No devices found." It seem like this shouldn't be an issue because with Linux the device finder should automatically pick it up. Regardless I tried following the MAC instructions and setting the device with fx set-device 127.0.0.1:22. That just makes the run command say "ssh: connect to host 127.0.0.1 port 22: Connection refused". I also tried to set it to the device to the nodename outputted by the fx qemu -N command which is "fuchsia-####-####-####" but that just makes the run command say no devices are found again.
I have verified that I actually have the hello-world packages with the fx list-packages hello-world which outputs all the hello-world packages as expected.
Is there any way I can get the device to be discoverable by the shell command? Alternatively, can I run components like the hello-world component from the qemu emulator directly?
Please let me know if I can provide any additional information.
I guess I just wasn't patient enough. I assumed the emulator was done getting setup because it stopped giving console output and it allowed me to input commands but it seems I just had to wait longer. After 50 minutes of the fx qemu -N command running, the terminal that had fx serve-updates going finally picked up the device. Then I was able to execute the hello world component. It would be nice if the documentation at least gave an idea of how long the different commands would take before they'd be usable.

How to install hcitool in mac os terminal

Hello there guys i have been trying to use hcitool on mac os terminal but whenever i type hcitool scan the following error is appeared -bash: hcitool: command not found i have tried pip install hci and pip install hcitool but the following error is shown
ERROR: Could not find a version that satisfies the requirement gatttool (from versions: none)
ERROR: No matching distribution found for gatttool
please help me with this
Commands such as hcitool, gatttool, hciconfig, etc. are part of the BlueZ package which works on Linux only. MacOS on the other hand is UNIX-core and therefore the commands will not run on a MacOS operating system. There have been hacks before to get some sort of functionality on MacOS OSs but the solution is always incomplete.
Your next best bet will be to use a Virtual Machine running a Linux guest (e.g. Ubuntu) and then use the BlueZ commands from within that VM OS.
I hope this helps.
Get yourself a Docker container up and running. You can write scripts that you keep in a shared volume between the host and the container (meaning you don't have to log into the container). You can then execute those scripts from your OSX terminal, to run in the container.
HTH

how to install netcat on genymotion

I want to install netcat on my genymotion to use wireshark. I tried alot and copied alot of netcat files in to genymotion but what ever i do the nc command will return nc not found.
It's been said than it can be downloaded from the belw link but i dont know what i should do:
https://android.googlesource.com/platform/external/netcat/+/master
Thanks
What you see in https://android.googlesource.com/platform/external/netcat/+/master is nc source code, not a ready-to-use binary.
To use it, you need to:
Compile the source using the NDK to produce a binary;
Send the binary to the device, for example using adb push path/to/your/nc /system/bin;
When this is done you should be able to open a shell inside your device with adb shell and use nc.

Resources