Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Support for ESP8266 wifi module #58

Closed
luc-github opened this issue Mar 11, 2015 · 90 comments
Closed

Add Support for ESP8266 wifi module #58

luc-github opened this issue Mar 11, 2015 · 90 comments

Comments

@luc-github
Copy link
Owner

as this device is very cheap ~5$ and only need 2 pins and +/- hardware changes are not hard to implement, thank g mcclean for pointing this out.
connection can be done using UART0 non populated connector on main board or any other available pins using softserial
Request is already done in repetier tracker but no response so far.

the goal is:
1 - to see if can allow TCP/IP connection with repetier host
2 - to get a replica of LCD panel on a web page

@luc-github
Copy link
Owner Author

Starting looking at documentation
seems SDK is available to make this module autonomous for a mini webserver so need to build fw for it, so should avoid too many change in Davinci FW for this support but push it to ESP8266 FW.

GPIO pin on this module is available, so can add led to give a visual status: connected, on, off...

also may need an additional pin to control the hard reset from printer

would be good to connect a switch to power off/on manually the module to avoid to unplug it if need flash arduino and there is conflict, this should allows to hard control the module

one part need to check if one module can listen 2 ports :
one for serial connection with host
one for web server
or another way to filter communication with host and communication with webserver

need to see if UART0 is not available for any reason, can we use software serial ? need pins available like using top sensor pin, jam sensor pin, spool EEPROM communication pin, etc....

an interesting task so far ^_^

http://rancidbacon.com/files/kiwicon8/ESP8266_WiFi_Module_Quick_Start_Guide_v_1.0.4.pdf
http://voltivo.com/forum/davinci-hwmods/775-using-a-5-wi-fi-module-i-now-have-a-wi-fi-enabled-da-vinci
Thanks to g mcclean for pointing this ^_^
http://hackerspace.pbworks.com/w/page/88183850/ESP8266
http://playground.boxtec.ch/doku.php/wireless/esp8266

@luc-github
Copy link
Owner Author

I need to finish 0.92.2 and 0.92.3 import and code cleaning first so will do next week

@disneysw
Copy link

(Different alias but I'm the person who created the ESP8266 thread on the Voltivo forum)

The board I suggest to you on the Voltivo forum, the ESP-01, has limited GPIO but there are other versions such as the ESP-07 and ESP-12 that provide access to more of the the chips GPIO pins.

The following site shows some of the variations.
http://l0l.org.uk/2014/12/esp8266-modules-hardware-guide-gotta-catch-em-all/

It should be possible to reset the ESP8266 by wiring its reset pin to the main processors reset pin so that a reset on one causes a reset on the other. Causing the watchdog to fail in software would then reset both. I believe the Da Vinci reset line is accessible via the right hand pads of SW2 which is the "Reset button" on V1 boards). My board did not have the button populated but I added it to make it easier when re-flashing the DDa Vinci firmware.

Hardware resetting of the ESP8266 is really only necessary if using the LUA I provided. After you questioned me on the Voltivo forum I thought about it some more and I think I should have stuck with my original plan and used the AT firmware for the ESP8266. While it involves a lot more changes to the repetier firmware the results would be far superior.

I'd be happy to do some work on this but I still need to get a better understanding of the repeter firmware before making changes and I don;t have a lot of free time.

@luc-github
Copy link
Owner Author

Hi welcome and again thanks for pushing this module, really good one - I was looking for this for another project and it match exactly my needs, so I will definitly jump on it ^_^

For GPIO I was just thinking about led, so I guess 2 are enough, I think the needs of more GPIO will be defined when we will better defined what we want the module do with printer.

About reset, actually I was mentioned it because I read on one forum that the board could stay in busy state if web browser is closed when displaying the web page - they mentioned (was in 2014) in future it could have a SW update fixing that, but waiting for this, a hard reset may be necessary to reset board time to time.
I just read and did not checked, but I preferred to put in the todo list than forget it ;)

Same for LUA or AT or new SDK based FW, I read people did a FW with embedded web server, and some create a library to help to build one, but did not did out more, too much to check, I read lua based can be easy, but I saw all samples using AT may need a FW update for carriage return, so actually I have no opinion, just a big willing to try all, to see what is best, but if you have already experience / opinion please share it - I am always willing to learn.

About Repetier FW -I am currently cleaning/reformating/commenting the code, I need to separate more clearly what is repetier and what is for davinci specific, as it is becoming harder for me to see quickly what impact a new update of repetier will have on Davinci FW.
When looking at their github, they mix several updates at once without clear explanation, so it is not easy to follow weekly, and sometimes of course with some bugs... That is why I do not push daily.
no mention that some updates are incompatibles with some changes I did. Repetier guys is more focus on Delta AVR when we (Davinci) only focus on Cartesian/Due. UI is now fully different and I introduced some feature before repetier that I need to merge now because Davinci has a lot.

All that to say: understand Repetier FW will be easier once I will clean up code, so no worry

I also would be really happy to work with you and learn from you on this. ^_^

@luc-github
Copy link
Owner Author

Ok 0.92.3 Import is finally done so now working on this promising topic

@luc-github
Copy link
Owner Author

I flashed my module with latest AT FW 0.9.5.2 which allow a connection at 115000 by default
I have read what can be done using AT FW and the one using SDK
My understanding is using the SDK is more for non arduino connected purpose / stand alone module like ESP8266 with some sensors and 2 batteries. as need to flash ESP module for any FW modification

The AT FW allows to configure the Module and change GPIO state, a webserver is also possible but handled by arduino : http://allaboutee.com/2014/12/30/esp8266-and-arduino-webserver/

I did not play with NodeMCU FW yet, but this guy made several videos using it https://www.youtube.com/user/AllAboutEE, looks like in between standalone - need to flash the scripts to ESP - but they can be called from serial according the needs.

Seems one module read only one port - so I do not see the way to use same module to be IP/Serial bridge for Host and be a web server to provide a LCD like UI - may need 2 modules

@luc-github
Copy link
Owner Author

Ok connector soldered - cables/plug done - Really not easy to do soldering on 2mm pins female connector....
so far printer still alive and Wifi module now power up -
Still need to think how and where to fix it and need to add a switch to be able to disable it without open the back of the printer.

Connector before and after :
connector

The module plugged :
plug

Tomorrow I will implement the module in FW using AT commands and a command to disable wifi in menu
I am thinking to use a command like M101 "SSID","Password" to store SSID and Password in EEPROM to avoid to hard code something in FW, and may be a M102 "AT Command" to handle the Module like scanning available networks, or any other useful command.

@disneysw
Copy link

There is a ESP8266 holder on Thingiverse (http://www.thingiverse.com/thing:642456)

@disneysw
Copy link

It is possible to host a webserver directly on the ESP8266 without any addational hardware, see http://www.esp8266.com/viewtopic.php?f=6&t=376, however given it is being connected to the Da Vinci processor it probably makes more cense for its processor to handle the task.

It really just boils down to a design decision and how far do you want to stray away from the master Repetier firmware.

@disneysw
Copy link

The following article might help if you want to know more about directly programming the ESP8266 i.e. bypassing the AT or LUA firmware images to create you own application directly on the device.

http://hackaday.com/2015/03/18/how-to-directly-program-an-inexpensive-esp8266-wifi-module/#more-148943

@luc-github
Copy link
Owner Author

yes saw the holder, do you use it ?
actually I think AT based module is only for building a bridge with repetier host

to get webserver allowing to start a print from sd, giving status and sending message when done, it is better to build embeded fw on module to avoid to overload Davinci (due) board, but need to hook some events in repetier fw to trigger some status\messages

I do not think it is necessary to have both feature at once because repetier host allows push messages already,but in this case it make no sense to have to flash module according usage, better just to choose on printer menu

what do you think? from your perspective what do you expect the module/printer provide to you?

@disneysw
Copy link

No, I just have the device dangling out the rear of the printer :-)

First let me say I do not understand why "Repetier Host" supports TCP connections yet there is no support in "Repetier Firmware". Are there plans to support TCP in the Repeiter firmware?

Knowing the answer to this would make the following an easier choice.

If the Repeiter firmware is not going to support TCP connections/settings then it makes sense to use a feature of the ESP8266 where it can simultaneously acts as both an AP and a AP-Client simultaneously. In this mode you would connect to the ESP8266’s AP, be presented with a web page hosted on the ESP8266 that allows scanning the local Wi-Fi, selection of a SSID, definition of the Wi-Fi password and to see the allocated IP once a connection has been made to the private Wi-Fi. The ESP8266 would then remember both the SSID and password which it would use to automatically log back on to the local Wi-Fi when power on. So basically the web interface is just used to connect the ESP8266 to you LAN and the Repeiter firmware has no knowledge of any of the settings.

This is basically what this example is doing http://www.esp8266.com/viewtopic.php?f=6&t=376

However there is no reason why the SSID and Wi-Fi password could not be set via the Da Vinci LCD.

It is just this would require adding new settings to the Repeiter EEPROM values which is why I asked the first question.

@luc-github
Copy link
Owner Author

about tcp/ip support here one answer: http://forums.reprap.org/read.php?267,396191
so no plan in fw
Yes acting like ap to setup to configure network is common way I agreed, I did not think about it as originaly printer is connected to usb to flash the fw, so short path was to end by configuring network, and my idea to use M101 to setup ssid/password is just because of bad ergonomy using printer keys to select alphanum entries, but of course can be done.
thanks for sharing , this bring more TODO ^_^

@luc-github
Copy link
Owner Author

about ssid/password storage, you mean there is a way to store them in esp8266 fw ? I did not found AT command for this, I need to see in SDK

@disneysw
Copy link

The ESP8266 has a small external flash chip which is used for storing its firmware. This can also be used for persistent storage of configuration data. The LUA and possibly the AT versions of the firmware do this so to allow automatic reconnection on power on.

As for the alternative, I presumed it would be possible to create new variables in the EEPROM data and at those variables would automatically become editable in Repetier Host bypassing the need for alphanumeric entry via the LCD i.e. the EEPROM data is self-describing. This is not something I checked!

@luc-github
Copy link
Owner Author

well a network password in clear is not a good idea, it should be encrypted or at least not easily visible, that is why the idea of M101 command, which store password in EEPROM but not visible and encrypted
but if there is a way to to store it in esp8266, even better, will check the docs

@luc-github
Copy link
Owner Author

One point of not using Host UI : Repetier EEPROM has no type for string, neither variable length data, all is based on strict position in EEPROM, so if need to use the EEPROM interface for password it means rewrite the all EEPROM functions and we cannot rewrite the host part so it won't be possible.

M101 command instead could be based on M117 command which accept string,

Just sharing,

@luc-github
Copy link
Owner Author

Ok seems when setup is done, all nework informations are stored automatically - no need to mention need to store ( at least with AT commands)
so when module is power down, then power up, connection is done automatically, so no need to care about SSID/Password storage - just to provide information at initial setup-
my bad I missed this point during my first tests

@luc-github
Copy link
Owner Author

This FW looks doing the bridge : https://github.com/beckdac/ESP8266-transparent-bridge
I will test released binaries present in Github before building the full compilation tool chain and do some modifications (if necessary)
OOPS :@disneysw, seems you already play with for a while : http://www.esp8266.com/viewtopic.php?f=6&t=864
it is not good ?

@luc-github
Copy link
Owner Author

I have now a module with latest nodemcu-firmware, the flasher did not worked for my board the esptool.py was fine
I started to play with the lualoader but module become not responsive, or may be it is due the lualoader itself, I had to restart module and reflash it.

It seems the modules I have are little bit different: one has blue and red led blinking when power on, when the second one has only the red led blinking - and initial FW were different when I got them.

@luc-github
Copy link
Owner Author

Lua bring definitly more control compare to AT commands, and also allows to print less garbage during communications.
Now I am able to store SSID/Password in ESP module in a file, using a script and loading them in another one to connect to AP. I did not found an automatic way like with AT command, calling wifi.sta.config(SSID,PWD) seems necessary at each module restart.

So we can imagine a script that store all preferences to start AP or Station, DHCP or Static
so when module is starting just need to call the script "connect.lua", that will setup the IP connection
then call the server setup or set the bridge. I am not sure yet if it is good to include connection in init.lua, if something is wrong and module crash or is in loop, soft reset is not working, so the only way is to reflash the FW, adding a timing delay as suggested in wiki could also be a solution to access module before init.lua start.

Additionnally, because when server listener is in loop, there is no way to stop it without adding a check that would decrease the bridge performance - I think adding a pin to do the hard reset if we want to change configuration when server is started would be a good solution IMHO, but need also to reset the serial connection in same time with module.

:@disneysw I saw you setup 19200 in your script - any reason not to set 115200 or even higher?

@luc-github
Copy link
Owner Author

Web UI should looks like this one for configuration
image
with some Javascript
image

based on the very simple code of http://randomnerdtutorials.com/esp8266-web-server/

so actually module can have 3 modes, only one at once :
Configuration / Bridge / Front End, default one will be Configuration of course if no configuration file
Can have 2 access modes :
Station / AP, by default for configuration will be AP(SSID:Davinci/Davinci) if no configuration file
And 2 network modes :
DHCP or Static IP

Save will save the changes and apply them at next restart, Apply will save the changes and apply them immediately.
I will implement Configuration and Bridge mode first, for Front End, need to define what should be done.

Any comments/suggestions about this ?

@disneysw
Copy link

You seem to be getting on well.

Above 19200 baud I ran into issues due to lack of flow control on the serial connection. The Repetier firmware is based on processing a single character at a time but TCP connections transmit packets. I believe it is the burst nature of the packets which is causing the problem. This could probably be resolved on the Da Vinci side by increasing the serial buffer size or changing the GCode::readFromSerial() routine to deal with packet structures rather than processing the individual characters.

You are probably thinking wait, the repetier protocol has a concept of acknowledging receipt of commands (ping-pong), but this increases the latency of individual commands so is not a great strategy when using a guaranteed transmission service like TCP.

Thanks for the info on the EEPROM. Glad I did not waste time on that idea!

Sounds like the only way forward is to use the Web UI for configuration.

If that is the case there is probably no requirement to have any UI via the Da Vinci LCD. The ESP8266 could either be enabled using a #define during the build or the repetier firmware could be modified to take commands from both USB and serial simultaneously.

@luc-github
Copy link
Owner Author

Thank you for the feedback as did no test connection with repetier , just simulating answer on keyboard to see if basic is ok, will test using bigger cache size, I am just afraid the about the impact on pause command. I will keep the modification of the readserial() for the end. About repetier protocol ( binary one not text one) - in addition of acknowledgement there is a checksum (https://github.com/luc-github/Repetier-Firmware-0.92/blob/master/repetier%20communication%20protocol.txt)

About UI on printerm, it would be simple in case of no PC on USB and new access point for any reason, in a wifi menu :
1 - to allow to enable/disable wifi (flag stored in EEPROM)
2 - to reset AP with default SSI/password (if forget password)
3 - to allow to switch to config mode any time (if local network is no more accessible)
4 - Get Network information SSID/IP/Connection status

I think UI and repetier should be ready next week as all is pretty clear and defined so far.

Sorry to be slow for implementation, I am also busy building another printer from scratch and real life ^_^,

Thanks again for bringing this nice module, your code and sharing your experience

@luc-github
Copy link
Owner Author

Ok - still fighting with lua and nodemcu bugs and limitations:

  • module filesystem need to be formated after several uploads - lost a lot of time to find out why I cannot upload my files when everything looks ok ...
  • script is limited to 4K comment included - removing comment/code help a lot for the size but not for the readbility
  • some bugs in table type variable - lost a lot of time to find out must not use too many data[SSID]="..."
  • execution memory is also limited so need to optimize all actions to avoid a not enough memory, like avoid function call, limit to minimum number of variable

Anyway - I am almost ok for UI page, just 2 bugs to solve before first release on github, I should find a solution this week end if no new bug,

  • display is Ok
    • save to file crash due to latest optimizations - it was working before so I am confident
    • IP/Mask/Gateway have a dots that change 192.168.1.1 to 192 once extracted from query, seems issue with regular expression but did not look at it yet

image

@lkarlslund
Copy link

I am following this with interest. But I looks as if you're trying to invent the square wheel. Implementing the serial to wifi bridge in Lua is ineffective, and others have problems getting any reliable throughput.

Have you seen https://github.com/beckdac/ESP8266-transparent-bridge?

It only lacks configuration from the serial side, and you could then do all configuration from the Repetier firmware.

Also I'm guessing you could add the ESP8266 to the "bluetooth" serial port of Repetier and have it as a 2nd connection, so USB is primary (firmware updates) and the ESP8266 is for everyday use (printing etc).

@luc-github
Copy link
Owner Author

Well yes I saw it, read above : #58 (comment) but did not test it, I saw @disneysw tested it - but he did not feedback yet -
@disneysw any feedback ?
and he is the one who provided the lua code for the bridge

-- Transparent WiFi to UART Server
-- -------------------------------

-- Once started the only way to terminate this app is via a hw reset

-- Open a listening port on 8080
sv=net.createServer(net.TCP, 60)
global_c = nil
sv:listen(8080, function(c)

-- Loop around reading/writing data
if global_c~=nil then
global_c:close()
end
global_c=c
c:on("receive",function(sck,pl) uart.write(0,pl) end)
end)
uart.on("data",4, function(data)
if global_c~=nil then
global_c:send(data)
end
end, 0)

I did not experienced performance issue on communication, but I did not stressed it yet.
also my purpose is not to only do a bridge but also have a simple front end to handle / get status of printing Job, like on phone, right now I am only focused on UI to configure network.
That said I am still discovering the module, I played with AT FW and found lua one is better, I have no doubt creating an embeded fw will be better - just more heavy to do, so I keept it for the end if lua does not fit the needs.

@lkarlslund did you tried the bridge FW ? any feedbacks ? you have which Davinci board ?

@luc-github
Copy link
Owner Author

well it depend what you want to do but I won't suggest big web page as they take time to be send by module when they are in memory so should be same when on this FS.
I worked to reduce the css file because displaying pages took too long with 15k css now it is around 3k and it is correct. currently each page is less than 8k css included - so it should be ok even on 64K SPIFF of ESP-01
Bigger space may help for pictures, but will also bring more delay for displaying pages as module is not multitasking, so first send page then image 1, then image 2 etc.... that is why I embedded css in page, it also save time.

using SPIFF fs will definitely help for page customization but need to write template engine for UI, so yes there is lot of space for optimization and improved UI (more javascript, better css, template, etc...)

here space for your reference:

Board Flash chip size, bytes File system size, bytes
Generic module 512k 64k
Generic module 1M 64k, 128k, 256k, 512k
Generic module 2M 1M
Generic module 4M 3M

@luc-github
Copy link
Owner Author

feel free to join https://github.com/luc-github/ESP8266 and push any code or ideas/suggestion / feedback
you are welcome

@luc-github
Copy link
Owner Author

FYI: I just released the ESP FW using templates - I did some long test run on PC first and web UI is now (more ❓ ) stable - did not got any crash in 72h
I did not have time to test on printer yet, but as workload is decreased on ESP side because UI is handled by client, it can only be better 🙏

@luc-github
Copy link
Owner Author

After first tests so far so good - latest ESP FW now allow to launch a print from SD Card
current Davinci Repetier FW work with it so I will close topic

I will add additional setup descriptions for not DAVINCI boards on my ESP github for standard repetier with DUE/RADDS and may be marlin

@netpipe
Copy link

netpipe commented Jun 3, 2018

is there a wire diagram for the esp-01 module ? im unsure what the order from the uart pins on the davinci are.

@luc-github
Copy link
Owner Author

@netpipe
Copy link

netpipe commented Jun 3, 2018

also is there a way to start a print from a file on sd card. if i were using flashair to put a file called command.txt on with the command run filename.gcode inside of it. it could delete the file after it initiates the commands inside it when its ready for more.

@luc-github
Copy link
Owner Author

if you use ESP3D yes
if you do not use ESP3D repetier is looking for "init.g" at start, if present it launch the print for this file, but I never tested this feature

@thomastech
Copy link

Hello,

Thank you for sharing the ESP3D project. I've flash a nodemcu with ESP3D. It is not wired to my Davinci 1.0A yet, but I can access the web page and have configured it (set to static station and so on). So that is good news.

I've read through the docs and I have a couple unresolved questions:

  1. I'm running 0.92 Davinci Repetier FW. Can I continue to use it with ESP3d, or do I need to change to a different version?

  2. I need some advice on the UART wiring. I found two unpopulated UART headers on the Davinci 1.0A controller: UART-MAIN and UART-PC. See photo.
    davinci_pcb
    Before I try a coin toss, I thought I'd ask which is the correct header to connect the nodeMCU?

  • Thomas

@luc-github
Copy link
Owner Author

On davinci 1.0/2.0 there is not choice but enable wifi

On 1.0a I would guess UART PC is the USB connector (Serial USB/Native USB port) and UART main is Serial / programming port
if it is the case using UART PC would not need to update FW but you cannot have USB and ESP in same time, using UART need a reflasfh but keep the feature to connect to PC

@thomastech
Copy link

Thank you for the quick reply and advice.

I checked Configuration.h and can see the magic ENABLE_WIFI define is disabled. So I'll need to enable the WiFi function and re-flash.

I would like to retain the PC UART for USB. So I will also try changing Configuration.h to use SERIAL1 for the WiFi communication. I believe that is what you meant I should do.

I'm still debating if I should continue with the ESP3D or switch to the Octoprint instead. I have the build experience and parts to either solution. I'm attracted to Octoprint's vast features, but the simple installation of ESP3D is a compelling benefit. So I have more things to think about.

Thomas

@luc-github
Copy link
Owner Author

It is definitly question of choice and usage - I personnaly only print from SD and I use S3D as slicer, so using octoprint is not a must
Octoprint has more power / features but setup a pi system cost more than 5$ ESP chip - current limitation of ESP is the file upload which is slow like hell unless you connect it to the SD card reader printer - so it need the printer board to be ready for this

there are pro / cons for both IMHO

@thomastech
Copy link

I also use S3D and print from a FlashAir card. The DaVinci is in a downstairs room so I use a LAN->USB printer adapter to remotely select/start print jobs from S3D's Machine Control Panel. I believe that the ESP3D functionality is emulated by my current setup, but in a more elegant way.

My main goal is to make my work flow more efficient. For example, since ESP3D works well with SD cards, it would be very helpful if had built-in function to handle FlashAir uploading. So if you have an open feature request list, how about adding a button to the Web GUI that (1) allows a user to select a file from his PC workstation, (2) sends it to the FlashAir, then (3) automatically starts the print. :)

I fully understand how much work it is to create and support techie projects like yours (I've been in your shoes many times). So this is just a wild-eyed wish request in case you have plans to extend the features. For sure, the project is already fantastic.

  • Thomas

@luc-github
Copy link
Owner Author

Flashair support is in ESP3D list already (luc-github/ESP3D-WEBUI#19)

Even not yet integrated, because first try was a failure due to Flashair webserver does not allow query from another web server (there is no way to add "Access-Control-Allow-Origin: *" in flashair currently) .

Flashair can already be used using Camera tab (which is just an iFrame) to access to Flashair File manager (also on my repo with an updated version : https://github.com/luc-github/Flashair-FM/tree/devt) to do file upload, then just back to main tab you can launch the print from SD panel

I am still thinking how to integrate both UI in one panel keeping UI consistency - I have already some ideas but I have other things to finish first

@thomastech
Copy link

thomastech commented Jun 4, 2018

Flashair support is in ESP3D list already (luc-github/ESP3D-WEBUI#19)

Thanks for the link.

Flashair can already be used using Camera tab (which is just an iFrame) to access to Flashair File manager {snip} ...

That's a nice workaround. My printer's IP camera does not work with the WebUI's iframe so the camera tab will be put to use with FlashAir instead.

(also on my repo with an updated version : https://github.com/luc-github/Flashair-FM/tree/devt) to do file upload, then just back to main tab you can launch the print from SD panel {snip} ...

I installed your new FlashAir file manager. Initially I had trouble getting it to work (FlashAir would not connect to WiFi). But I discovered that the new CONFIG file had UNIX EOL conversion. After rewriting the file with Windows EOL the WiFi access was Ok. Now I can web browse the FlashAir card via WiFi and your file manager works great.

I tried accessing the SD card from the WebUI and ran into "trouble." I don't see any SD Card file names. Then I realized that I don't have the NodeMCU wired to my printer so all this trouble will go away when I get it wired.

I am still thinking how to integrate both UI in one panel keeping UI consistency - I have already some ideas but I have other things to finish first

That is great news. Good luck!

@thomastech
Copy link

thomastech commented Jun 5, 2018

After some o-scope measurements I discovered that the UART-MAIN is inactive (missing components). So the ESP3D module was wired to the UART-PC port on my Davinci 1.0A.

The WEBGUI is now controlling my printer. It reads the SD card, starts print jobs, controls motors, and so on. The WEBGUI works very nice.

But after that bit of happy news I discovered that my printer is messed up. The Z-axis limit switch and top lid detect switch are not working. This bit of bad news was discovered on my first print job; It crashed the Z-axis into the frame when the hot end was sent to the home position. Ouch!

The printer was working before the reflash. All the cables are plugged in. So I believe it has something to do with today's new Arduino upload. I was hoping to get a bit of advice on the problem.

Here's some background info.

  1. The last time I flashed the printer was in Oct 2015 when I installed Repetier in my DaVinci 1.0A.

  2. The WIN7/32 system I used in 2015 has been retired and I now use a WIN10/64 system. All the sketch files from the old PC were copied to the new PC.

  3. I am using the exact same (working) sketch files from 2015. The only change is that I enabled WIFI.

  4. My Arduino IDE is 1.8.5 (instead of 1.8.0). The Arduino SAM Boards Cortex-M3 is version 1.6.8. I believe I used Arduino IDE version 1.6.5 with DUE 1.6.4 back in 2015, but I'm not 100% sure.

  5. I changed the two AdditionalArduinoFiles (USBCore.cpp & variant.cpp) using the branch for Arduino - 1.8.0 -Due 1.6.8 that I downloaded from github today. I do not know if these files are a good choice for Arduino IDE 1.8.5.

  6. The files were compiled with Arduino Due (Native USB Port) Board type. There were some compile warnings (possible uninitialized variables) but no errors.

  7. During initial use I noticed that the printer's eeprom.bin file was replaced with default values.

  8. The printer appears functional except for the missing Z limit and top door detection.

Fingers are crossed there's a easy answer to my problems.

  • Thomas

@luc-github
Copy link
Owner Author

the variant / pin number has been modified on Z to avoid pin on 127 6e6edc0

the sketch you use (2015) is for previous variant not for the latest one, if you use the 2015 sketch - use this variant - it should solve your issue : https://github.com/luc-github/Repetier-Firmware-4-Davinci/blob/7c0cb5b01cd98d67f19dd57c4a46150477045027/src/ArduinoDUE/AdditionalArduinoFiles/Arduino%20-%201.8.0%20-Due%201.6.8/Arduino15/packages/arduino/hardware/sam/1.6.8/variants/arduino_due_x/variant.cpp

it is a mismatch between variant/pinout

@thomastech
Copy link

thomastech commented Jun 5, 2018

Thank you for the help, I appreciate it.

The revised variants.cpp causes a compile error. Attached is the compiler output.
compile_fail.txt

So hoping to avoid consuming more of your time I decided to start fresh using your latest Repetier distribution (Aug 2017 build 1). I am using the matching variants.cpp for it. When I compile there is a fatal error due to a missing variant.h. Compiler output:
compile_fail2.txt
I cannot find this file in the Arduino installation and it is not in the Repetier release. Google was no help either.

So I'm back again looking for more advice. I don't mind using the old 2015 sketch files or the latest Aug 2017 release. Whichever version you feel is the best to use is the solution I will use.

  • Thomas

@luc-github
Copy link
Owner Author

I think you messup your files with all the changes
variant.h is provided by due module - I am guessing you deleted it when you deleted variant.cpp

for the other error it is not linked to variant you updated but :
#error "You cannot use DISPLAY_D5_PIN, DISPLAY_D6_PIN or DISPLAY_D7_PIN for "User Keys" with character LCD display" which I have no idea what is come from

I think the best is to delete all, FW and Due module, be sure C:\Users\Tom\AppData\Local\Arduino15\packages\arduino\hardware\sam\ is empty, and do a fresh install:

1 - reinstall 1.6.8 due module
2 - download latest git for repetier
3 - update usbcore and variant as needed
4 - modify configuration.h for model = 1 and Wifi and reflash

I think this is the only advice I can give you

@thomastech
Copy link

thomastech commented Jun 5, 2018

You are a lifesaver! A fresh re-install of 1.6.8 due solved it. I don't have an explanation for the missing variant.h file (it wasn't in the trash bin, so I didn't directly delete it).

My working build is the latest Aug 17 Repetier distribution compiled on Arduino IDE 1.8.5. Just thought I'd mention that since it validates that 1.8.5 is Ok to use (versus 1.8.0).

Although yesterday's Z-axis head crash was severe, I think everything survived. Nothing visually is broken and a freshly printed test block looks OK.

The latest firmware has some new WiFi status messages that I didn't notice on the old 2015 version. So I am glad I abandoned the old release. Today's compile trouble lead me to use the new release, so I guess the extra frustration provided a better ending to my adventure.

I would like to say that the ESP3D mod is worth the effort. The WebUI is fantastic. Nicely done! Thank you for sharing your work.

I will soon post some photos of how to wire the NodeMCU WiFi module to a DaVinci 1.0A. Perhaps it will help someone else. It's the least I can do to contribute to the project.

  • Thomas

@luc-github
Copy link
Owner Author

Thank you
Yes sharing your wiring on 1.0A would be great - you can directly add it to the wiki page - they are open to everyone

have fun ^_^

@thomastech
Copy link

thomastech commented Jun 5, 2018

I edited the Wiki but I cannot upload any photos. I identified an image folder that appeared to be the logical place for the images. All links in my WiKi edits point to it: https://github.com/luc-github/ESP3D/tree/master/images/Davinci

Upload attempts state "File uploads require push access to this repository." I tried to use git-scm but I keep getting 403 errors when I push my images. I'm not very familiar with using git and github so the magic to adding new file content remains a mystery to me.

EDIT: Davinci 1.0A ESP3D Installation photos removed from this post and added to Wiki (thanks to luc-github). https://github.com/luc-github/ESP3D/wiki/Davinci-1.0-and-2.0-board

Thomas

@luc-github
Copy link
Owner Author

I have updated images - thank you

@thomastech
Copy link

@luc-github Thanks for adding my images to the wiki. I'd rather have done it myself but I'm not familiar with the image upload process. The push instructions I followed ended with the 403 error, which probably means I don't have permission to do it.

I'm enjoying the ESP3D features. The workaround of using the camera tab for the FlashAir SD card uploads has helped a lot. Overall ESP3D has improved my workflow.

I came across another wish list item. It would be helpful if the WebUI had WiFi RSSI (receive signal strength indicator). I think the best location for the RSSI bar graph would be in the title banner area near the camera icon.

Thanks again for publishing the project and all your fantastic help solving my installation problems.

  • Thomas

@luc-github
Copy link
Owner Author

The signal strengh is actually in ESP3D status page
Have fun with your new toy

@thomastech
Copy link

thomastech commented Jun 6, 2018

The signal strength is actually in ESP3D status page

Awesome, found it there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants