Has anybody besides me figured out what a great team these are? Connect it to one of the usb ports on the RB433UAH, and suddenly you have a bunch of control.
You can login to the usb (serial) port on the Arduino from the router. I have a “console” program that works good with this router. I can read digital and analog pins, control digital and PWM output.
The Arduino can login to the router through the usb port. (requires a jumper cut on the Arduino). Haven’t finished this yet, just the login.
54 digital i/o pins, of which 14 are 8-bit PWM outputs.
16 10-bit analog inputs
4 port UART, SPI, I2C, etc…
The ethernet shield has both server and client (http and smtp) capability. Connect it to ether2 and away you go.
add: I forgot to mention the microSD “hard drive” on the ethernet shield. Mine is 2GB.
All powered by the RB433UAH usb port.
This is fun!
Is anyone interested in a wiki on this?
Edit: These Arduino boards are not for the beginner. If you are not at least familiar with C, this is not for you.
I can see this being useful for literally unlimited number of applications! Thank you for letting me know about the usb compatibility, that is great!!!
i just need to know how to mount the usb serial port to a port number as above its “serial0”. How can I make the usb serial for example serial1 and then i can share serial1 via the network and access it from my pc.
Then ssh into the router. At the “Login:” prompt, enter user and password arduino, and you login to the usb port of the Arduino as if you were using the serial monitor. Connecting resets the Arduino unless you have cut the “reset-en” trace on the Arduino.
Or you can access the usb port direct.
/port remote-access
add port=usb1 tcp-port=8088
If you connect to the router using the ip and port 8088, you connect to the Arduino. Connecting resets the Arduino unless you have cut the “reset-en” trace on the Arduino.
I have an ethernet shield connected to one of the ethernet ports also.
edit: If you have remote sites that need a bit of security, this is the ticket. Monitors door/window/gate switches, controls cameras and lights,etc…then can send an email/sms to your cell phone if there is a problem.
I’m on the arduino forum as SurferTim. Stop by if you need help. http://forum.arduino.cc
My specialties are the ethernet shield and the SPI bus. I hang out in the Networking section.
Hi. It is posible to read the RSSI signal strength of the router via arduino and show it in an LCD conected to arduino in real time?. It could be usefull to align antenna, even more the arduino could control some servos to do that.
I had the same idea, but I need to read the signal strenght on a LTE interface. Such as lte1.
If arduino can read it, I can control a motorized antenna and do a sweep to find the best orientation.
I have not found a way yet to go the other way. I can connect to the Arduino through the Mikrotik router, but not connect to the router from the Arduino. Maybe telnet from the ethernet shield to the Mikrotik router would work.
Hey all, I know this is an old post but I think you guys can help me out.
I would like to read the serial output of an arduino connected using USB.
Every 1 minute the arduino is sending/writing to the serial the following:
“humidity:33.00,temperature:26.51,pressure:980.08”
I used everything you guys mentioned to enable the port but I keep getting errors in my logs saying:
“login failure for user humidity:33.00,temperature:26.51,pressure:980.08 via local”
I figure out that the RB expects login credentials first. How would I do that ?
Eventually I would like to save to the log file these data.
Are you wanting to store these values on the actual RB, or on a pc some where.
Cause you have two options.
1: use the mikrotik to make a Virtual comport, Which you then run a client software on your pc, wich then allows you to get access to the ardruino.
It basically makes a pipe, from the pc to the ardruino. This can be over the internet or LAN / wireless what eva.
This would be the easiest, as you can use c# or any other pc language to deal with the serial messages.
2: Connect to the ardruino from the mikrotik, and log it locally. I haven’t tried this my self, but I think the easiest way would be to write a script that asks the ardruino for its message and it then response with the message, and you save it in a file. Rather than listening the entire time.
No I don’t want to use a computer to read any values. I think option 2 is more close to what I’m trying to do.
Basically the idea is for the arduino to dump serial data to the mikrotik and store them on the mikrotik’s logs (memory not disk)
Then a mikrotik script will read the logs, find the ‘arduino’ logs and pushed the results to a webservice. I’ve written the mikrotik script and the webservice. So I’m missing the part where mikrotik logs the dumped serial data.
My apology for not experimenting with this in a while. I’ve been busy with another project. I am now at a point where this function would be useful.
I will try to make time soon to see if I can login to the Mikrotik router through the USB port. That would probably be the simplest solution involving the least amount of hardware (no ethernet shield).
Maybe I can get some assistance from MikroTik support, it would help. Any ideas?
I then wrote a script to read the ‘arduino.dat’ every 5 minutes, get the last line and then log the line the console and also push it to a webservice.
Notes:
The tricky part was that you can only read from a file that’s less than 4096 so I had to delete the file once I read it and then recreate it.
Also all lines read from the ‘arduino.dat’ contain the \r at the end to indicate a new line (carriage return). I had to clean that special character counting the length of the line and then deleting the last character.
You can find the final working code here if anyone is interested:
if ( [/file get [/file find name=arduino.dat] size] > 0 ) do={
:global content [/file get [/file find name="arduino.dat"] contents] ;
:global contentLen [:len $content ];
:global lineEnd 0;
:global line "";
:global lastEnd 0;
:global lastLine "";
:global sizeOfLine "";
:do {
:set lineEnd [:find $content "\n" $lastEnd ] ;
:set line [:pick $content $lastEnd $lineEnd] ;
:set lastEnd ( $lineEnd + 1 ) ;
:if ( [:pick $line 0 1] != "#" ) do={
:local entry [:pick $line 0 $lineEnd ]
:if ( [:len $entry ] > 0 ) do={
:global lineSize [:len $entry];
:set lastLine $entry
}
}
} while ($lineEnd < $contentLen)
# push data to webservice
:set sizeOfLine [:len $lastLine];
:local thisLineSize ($sizeOfLine - 1);
:set lastLine [:pick $lastLine 0 $thisLineSize];
:tool fetch url="http://URL/post.php\3Freadings=$lastLine" mode=http dst-path=arduino.reading
:log info $lastLine;
}
# housekeeping. delete file and recreate to be able to read it next time before it reaches 4096 bytes
/file remove arduino.dat
/port remote-access disable [find where port=usb1 ]
/port remote-access enable [find where port=usb1 ]
Some time ago I was trying to connect arduino with mikrotik, but not enough help obtube. the aim is that by network, arduino send telnet commands to modify the behavior of mikrotik several buttons.
Here I leave a link to what I got. if anyone can help me.
Is this also possible for the mikrotik hAP lite TC (RB941-2nD-TC)?
I want my Arduino+Ethernet shield to communicate with the hAP lite using its LAN Ports but apparently there’s something wrong with the ethernet shield. My shield can’t link with the hAP lite but when i tried to connect my Arduino+Ethernet to my PC using RJ45 Cable, there’s no problem. My guess is that i will use modem and connect my hAP Lite to the modems LAN Port (Lets say LAN1) and my Arduino+Ethernet shield to (LAN2) then let them communicate using TelnetClient. The thing is that i can’t Telnet to my hAP Lite from Arduino+Shield using the provided IP Address in my modem. Am i missing something?
any news about 4kB limit problem while logging data from serial port ?
in latest stable version (now 6.48) still not solved, log stoped exactly after 4096B
workaround with delete file and enable / disable remote access on port dont solve the problem,
logging stop after receiving 4KB while file is smaller after delete and re-enable remote access