Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I'm trying to do a high school project, where i want to create a remote control car with mecanum wheels using matlab. Would anyone know if this is possible and how it is done? I have ordered matlab now and it being shipped, therefore i can mess around with it soon.
MATLAB can communicate with external peripherals using an RS-232 serial port. (That kind of port, usually found on older computers, can be added to newer computers using a USB adapter.) You'll want to build or find a radio control system that can use that interface to connect to the computer, and then you will need to write a MATLAB program to send the correct commands in response to user input, sensors, etc.
Typically you need the following:
A computer with matlab, and an
gpib or some kind of io port
that can interface with your
actuator (in your case you
probably have 2, 1 for steering and
moving back and forward).
An I/O device that matlab can
connect to (typically it is serial
port as idealmachine said, but you
can get serial to usb/serial to
Ethernet drivers that make the
device look like serial devices if it is not specifically an RS-232 connector)
such as the serial port, and
make sure that device can properly
interface with your actuator. You may need the Instrument Control Toolbox
You must find an I/O device (the gpib or some other device - national instruments has a large variety that are as easy as plugging in a USB and only as hard as plugging a PCI card into a pc) that can read/write to your actuator. Make sure you:
Have the proper device drivers for your I/O
device for you PC
Understand what kind of signals your
actuator will accept
The fact that you are using mecanum wheels is less relevant than setting up your interface to those wheels. This undertaking is not simple, and may be out of the scope of your high-school courses, unless you have some really great teachers of course. Also this project will probably cost at least $3-400 after buying the I/O devices and your R/C car (if you have a computer you can use), matlab, and your actuation devices (if you need to get different ones or modify the existing equipment on the R/C car). Doing this wirelessly is just one more complication to your system - start off wired, then once you get the hang of it move up to wireless.
well you can always use an Arduino, Arduinos will be connected to Transceivers which will act as master and slave at the same time, control your car from Matlab, send code to Arduino and watch the magic happen.
Am I sure?
Yes, I am building one now however with automatic response, initial tests worked
so to answer your question, it is possible.
Related
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 1 year ago.
Improve this question
I am currently teaching a remote middle school summer camp next year that involves microcontroller programming. I’ve chosen to avoid Arduino microcontrollers for the camp and use a MicroPython compatible microcontroller instead. One microcontroller that I am interested in using is the Lolin V 1.1.0 with an ESP-Wroom-32 chip since it is cheap and reliable.
One downside that I’ve noticed with this MCU is that a VCP driver needs to be installed in order to establish a USB to UART connection (It contains a CP210x chip). I’m not too sure how many Operating systems have a VCP driver installed by default. However, I tested to see if the microcontroller was able to be registered on three of my different laptops. On two MacBook airs, my computer was successfully able to locate the MCU without a virtual driver installed. Similarly, I used a Windows computer and a connection was able to be established after 10 minutes (Not sure why it took this long). Finally, I tried it on my friend’s European MacBook and his computer wasn’t able to locate the microcontroller until I installed the driver.
I’m expecting that the camp would be ~300 students and I don’t want anyone to not be able to connect with their Microcontrollers and don’t want to include the installation of the driver since it can be tedious.
Does anyone know how big companies that teach Microcontroller programming to beginners such as MicroBit, Raspberry Pi, or Arduino deal with this problem? How do they ensure that the microcontrollers are read by the computer without having to have students to go through the tedious process of installing a driver?
What percentage of Operating systems have a CP210x VCP driver already installed?
Are there any microcontrollers that don’t require a USB to UART driver installation altogether?
Thanks!
Ryan
It's usually not so much dependent the choice of microcontroller, but rather the USB-UART chip on board. There aren't many of those to choose from. SiLabs CP210x and FTDI's FT232/FT2232 are widely used families, so you can't really go wrong with them. Windows installs drivers for both automatically and seamlessly. Linux has support built into the kernel for all major distributions. Don't have experience with Macs, I'm a little surprised you had to do anything manually. Driver support for FTDI devices tends to be a little better across the board.
If you're interested in ESP32 and have a little more budget than for the Lolin, feel free to try the ESP-WROVER-KIT which has the FTDI FT2232HL chip and is generally much more feature-rich.
The only one I am aware of that is pre-installed in windows is microchip PIC (eg PIC16F1454) but a PIC is not the best device for teaching. You have to run an application on the device to use USB VID:PID 04D8:000A.
I don't have a machine to test it but maybe a microchip MCP2200 (04D8:00DF) will be the same.
I want to make a network camera, stm32 through the camera to collect images, and then sent to the server through the WIFI module. As 1 second need to transfer a lot of data, so I would like to use the USB interface wifi module program to achieve. Or what better solution to achieve.
Thank you!
I think that you have no idea how the USB works.
You have a couple solutions.
Use a wifi module with SPI interface.
Use a SOC like CC3200.L
Use ESPxxxx module or similar (RTL8710)
You can of course try to use STM with host usb interface, but you will have to implement the USB host stack + driver for USB wifi module + network stack (eg TCP/IP stack). But it is quite complicated as the STM ones are not very good, there are some better paid ones - but expensive. USB host is not easy to implement.
If you want to go along the "networking over USB" path on STM32 (and I'm assuming you're not planning to buy any commercial drivers) it's going to be rough for you.
When it comes to USB, vast majority of the WiFi dongle drivers are proprietary and unless you're on an operating system such as Windows or Linux you're out of luck, unless you want to for the reverse engineering or porting at least parts of the drivers from Linux. With the USB you can think of using the USB-ECM (ethernet over USB) class, but two things here. One - ST doesn't provide any free implementations of this class so you're down do searching for it or implementing it yourself. After a bit of googling I've found one instance of this on githbu, although I havent tested it myself. Second thing - this is no longer wireless as you'll need to be connected to some kind of host providing internet connection, at which point it's probably better to not use USB-ECM and networking at all and just send data using a class that can be implemented easily (USB-CDC or USB-HID). I'm a bit worried about the throughput here.
You can also try to find WiFi modules that are connected over other interface. Generally those modules are connected over UART, some over SPI. This way, integrating it with the TCP/IP stack will also be up to you, at least when it comes to implementing the WiFi module protocol (most likely AT-commands) and implementing network interface so that the stack can "talk" to it. In this approach, I'm almost sure that you'll lack the throughput required for your application.
Personally I'd strongly suggest trying Ethernet if that's an option for you. It's going to be highest bandwidth (which you're going to need), plus it's most "out of the box". There's multiple projects implementing various applications using a free LWIP stack over this interface, including examples generated by ST's CubeMX.
I plan to extend the range of my Wifi with my Notebook. - My question to this, is it possible to build a wireless repeater with only one NIC? or do I really need at least two NICs, one for being logged in and receiving the packets and the other for extending the WiFi/Signal. - Actually, what I wanna do is, using my laptop as a WiFi-Repeater, but only with the built-in NIC, no second one.
I've searched the net already but found nothing about the functionality of a WiFi-Repeater and if they have two NICs integrated.
Hope you guys can enlight me ;)
EDIT(added schemes):
Possibility A
Possibility B
What can be achieved with an AP capable Chip/Firmware, for instance, the Ath9k.
You can't turn laptop's WiFi into range extender, since I believe it requires a special WiFi chip firmware and a special configuration of antenna(s).
However, you might try to look on the internet if WiFi chip you have supports AP mode in firmware (not all manufacturers provides that), and if yes, you can set up the access point with the same SSID. In this case your WiFi clients will roam from one AP to another. Of course, this kind of setup requires Ethernet cable attached to your laptop.
I have an external device that we manufacture that basically monitors 4 voltages, converts them to a 16 bit digital number then streams this info back to a PC every 100mS or so, using a serial over USB style chip. Basically a data logging system.
We would now like to collect this information on an iPhone and I am wondering what is the best way to get the data into the iPhone?
I am assuming there is no way we can physically connect directly to the iPhone dock connector as the protocol to do this is not available to iOS developers?
Obviously we could do it over a WiFi network but there will not always be one and we want to keep the external hardware fairly simple, i.e. no need for a computer or Wireless router etc.
If we add Bluetooth connectivity to our hardware would this work? I read that only 'Made for iPod' type Bluetooth devices will connect, in which case how can we achieve 'made for iPod' status? It would be relatively easy to add the necessary Bluetooth chips to get the system up and running.
In an ideal world we would like to do this without having to use a 3rd party interface.
I have been thinking about trying to digitise data as an audio signal – like a modem, and send it into the line input jack, but I don’t think it will be fast enough – this would be new territory for me.
Anyway all suggestions gratefully received!
Thanks!
I'm looking to connect my iPhone to an RS-232 serial device via Bluetooth. Has anyone implemented this successfully and can offer advice on hardware to use? It's kind of tricky because of the need for the Apple Authentication Processor with the device. The best potential device I've found is this guy but it only comes in an embedded package, its serial port interface is just logic-level UART rather than line-level RS-232, and I can't find a supplier with it in stock.
Any thoughts would be appreciated.
I'm considering just using WiFi to serial instead, but please ignore that possibility for the purposes of this question.
most of the question was answered by yourself already.
Basically you have 5 (+2) choices.
Join the MFi program. This might be hard to impossible if you are not part of a at least mid-size company.
Buy the OEM Bluetooth Module. I'm not sure if this is even allowed by the apple policies.
Use WiFi. Keep in mind that you want to use a wifi chipset that can act as at least ad-hoc access point. Those chipsets are quite expensive, and you have to think of a way to join existing networks (customers don't want to leave their home network to use your product). This will add a lot of cost to the BOM of your device.
Jailbreak might be an option. I never tried to use accessories with a jailbreak, so I don't know if it's possible to use bluetooth without authentication.
Work with a company that is member of the MFi program.
(Maybe an option, and depending of the speed you want to have via RS232: Eventually you can convert the audio output of the head-phone jack to RS232 levels and vice versa)
(Not really an option: develop for Android and do whatever you want)
If you jailbreak your device, you can use BTstack.org (disclaimer: I'm the author of BTstack) to connect to a Bluetooth device that supports the Serial Port Profile. You can get Bluetooth Modules that implement SPP and provide UART level output. As David R. above points out, you then need a UART to RS232 converter, e.g. the MAX232.
Ok. Another option. There are one or two companies that sell RS232 cables for iOS, eg. Skywire here: http://www.southernstars.com/products/skywire/index.html
Then, you could uses a Bluetooth RS232 extender, which consists of a RS232-to-SPP and a SPP-to-RS232 pair. Ugly, but within Apple's rules.
Well. It seems like my answer could be something you didnt ask for.
But the guy you referred to is the answer. Buy his product and you are good to go, all you need is a MAX232 chip. Converts logic level UART to RS232.
the diffrence high + voltage low zero voltage is converted to high +~10volts low -~10volts.
I use the MAX232 chip with my microprocessor, that uses logic level USART to communicate over RS232.
There is a lot of tutorials out there explaining how to hook things up.
This product works: https://serialio.com/product/bluetooth-serial-adapter/bluesnap-smart-bluetooth-40-ble-rs232-adapter
The only downside is that the adapter requires power.
It should be possibly I would think to create something in the middle that accept the bluetooth commands and convert them to serial, similar to what this does with TCP connections: https://www.npmjs.com/package/stellar-socks